This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug preprocessor/66505] New: -Wno-error=pedantic does not reverse -Werror -Wpedantic


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

            Bug ID: 66505
           Summary: -Wno-error=pedantic does not reverse -Werror
                    -Wpedantic
           Product: gcc
           Version: 4.9.2
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: preprocessor
          Assignee: unassigned at gcc dot gnu.org
          Reporter: chrysn at fsfe dot org
  Target Milestone: ---

the -Wno-error=pedantic option fails to undo the combined effects of -Werror
and -Wpedantic, for example when dealing with binary constants.

code like

    int main() { int i = 0b0; }

fails to compile with `-Werror -Wpedantic`, while it does compile with either
option, and adding the `-Wno-error=pedantic` option does not change that.

the error message shown is

    error: binary constants are a GCC extension [-Werror]

which indicates that no special-purpose warning exists for the behavior. it has
been suggested by redi on irc that a `-Wbinary-constants` should be introduced
(along with other specific labels like imaginary-constants) to combat this, and
that the relevant code is around libcpp/expr.c:697.

as a workaround, i'm explicitly setting every -Wfoo option (except -Wpedantic)
as -Werror=foo.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]