This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c/70502] New: inconsistent behavior of -Werror=
- From: "manu at gcc dot gnu.org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Fri, 01 Apr 2016 14:26:14 +0000
- Subject: [Bug c/70502] New: inconsistent behavior of -Werror=
- Auto-submitted: auto-generated
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.