public inbox for gcc-prs@sourceware.org
help / color / mirror / Atom feed
From: craigs@equival.com.au
To: gcc-gnats@gcc.gnu.org
Subject: c++/1940: No option for turning off reporting of mismatched "{" "}"
Date: Sun, 01 Apr 2001 00:00:00 -0000	[thread overview]
Message-ID: <20010212003515.18851.qmail@sourceware.cygnus.com> (raw)

>Number:         1940
>Category:       c++
>Synopsis:       No option for turning off reporting of mismatched "{" "}"
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    unassigned
>State:          open
>Class:          change-request
>Submitter-Id:   net
>Arrival-Date:   Sun Feb 11 16:36:00 PST 2001
>Closed-Date:
>Last-Modified:
>Originator:     Craig Southeren
>Release:        g++ 2.96 20000814 and later
>Organization:
>Environment:
Linux 2.2.14 kernel
>Description:
Gcc (since version 2.96) performs a check on every source 
file to ensure that every "{" is matched by a "}". This is
fine for most source files, but is not strictly required by either C or
C++.

  In any case, the OpenH323 project makes extensive use of 
the ability to start a class definition in one file, and 
then complete it in another file. We use the technique to 
provide a platform independent header for each class, which
is then completed by a file containing any platform
dependent declarations for that class.

  Our project contains hundreds of constructs of this type, and we
cannot easily change it as this point. Unfortunately, this 
warning cannot be disabled, so using any compiler after 
2.95.3 creates hundreds of lines of spurious warning per 
compilation unit.
~
>How-To-Repeat:
Download the OpenH323 source code from http://www.openh323.org
and compile with any 2.96 compiler
>Fix:
Find patch attached
>Release-Note:
>Audit-Trail:
>Unformatted:
----gnatsweb-attachment----
Content-Type: text/plain; name="t.txt"
Content-Disposition: inline; filename="t.txt"

*** orig.decl2.c        Thu Aug 17 23:38:06 2000
--- decl2.c     Thu Aug 17 23:56:44 2000
*************** int warn_nontemplate_friend = 1;
*** 353,358 ****
--- 353,361 ----

  int warn_deprecated = 1;

+ /* Nonzero means warn about files with unmatched braces */
+ int warn_unmatched_braces = 1;
+
  /* Nonzero means `$' can be in an identifier.  */

  #ifndef DOLLARS_IN_IDENTIFIERS
*************** lang_decode_option (argc, argv)
*** 784,789 ****
--- 787,794 ----
        warn_nontemplate_friend = setting;
        else if (!strcmp (p, "deprecated"))
          warn_deprecated = setting;
+       else if (!strcmp (p, "unmatched-braces"))
+         warn_unmatched_braces = setting;
        else if (!strcmp (p, "comment"))
        ;                       /* cpp handles this one.  */
        else if (!strcmp (p, "comments"))


*** orig.lex.c  Thu Aug 17 23:38:57 2000
--- lex.c       Thu Aug 17 23:57:01 2000
*************** linenum:
*** 2265,2271 ****
              --pending_lang_change;
            }

!         if (indent_level != input_file_stack->indent_level)
            {
              warning_with_file_and_line
                (input_filename, lineno,
--- 2265,2271 ----
              --pending_lang_change;
            }

!         if (warn_unmatched_braces && (indent_level != input_file_stack->indent_level))
            {
              warning_with_file_and_line
                (input_filename, lineno,


*** orig.cp-tree.h      Fri Aug 18 00:27:09 2000
--- cp-tree.h   Fri Aug 18 00:27:12 2000
*************** extern int warn_multichar;
*** 3226,3231 ****
--- 3226,3235 ----
     flag_guiding_decls in do_friend. */
  extern int warn_nontemplate_friend;

+ /* Nonzero means warn about files with unmatched braces */
+ extern int warn_unmatched_braces;
+
+
  /* in c-common.c */
  extern void declare_function_name               PARAMS ((void));
  extern void decl_attributes                     PARAMS ((tree, tree, tree));


             reply	other threads:[~2001-04-01  0:00 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2001-04-01  0:00 craigs [this message]
2002-10-21 17:30 zack

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20010212003515.18851.qmail@sourceware.cygnus.com \
    --to=craigs@equival.com.au \
    --cc=gcc-gnats@gcc.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).