https://gcc.gnu.org/bugzilla/show_bug.cgi?id=94948

            Bug ID: 94948
           Summary: Warn / fail on non-matching parentheses in a header
                    file before including it
           Product: gcc
           Version: unknown
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: preprocessor
          Assignee: unassigned at gcc dot gnu.org
          Reporter: koncek.marian at gmail dot com
  Target Milestone: ---

Created attachment 48449
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=48449&action=edit
Example

If a header file in a nontrivial project (especially in C++) happens to miss a
closing parenthesis (for example close a namespace) and this file is the
included in other TUs, the avalanche of error messages will make it hard to
locate the issue.
Yet GCC's preprocessor can very well detect it and warn against it.

However this would only make sense if the warning too was visible among the
other error messages.
When invoking the compiler from a build system doing multiple jobs, it may be
especially hard to make the warning visible. The user may also kill the whole
build.
So possibly a better solution is to make it a hard error, whether enabled or
disabled by default.

Reply via email to