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 c/70502] New: inconsistent behavior of -Werror=


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

            Bug ID: 70502
           Summary: inconsistent behavior of -Werror=
           Product: gcc
           Version: 6.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c
          Assignee: unassigned at gcc dot gnu.org
          Reporter: manu at gcc dot gnu.org
  Target Milestone: ---

According to the manual, -Werror=foo implies -Wfoo, however, these two
command-lines:

$ gcc -std=c89 -c -Werror=return-type -Wreturn-type  -Wno-all test.c

$ gcc -std=c89 -c -Werror=return-type -Wno-all test.c

produce different results for:

int foo() { return; }

I think the first behavior is the correct one (give an error). The problem is
caused by -Werror= not updating opts_set, which is what is tested by the
options machinery for options that imply other options.

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