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.

Reply via email to