[Bug c++/70275] New: -w disables all -Werror flags
fuscated at gmail dot com
gcc-bugzilla@gcc.gnu.org
Thu Mar 17 13:03:00 GMT 2016
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=70275
Bug ID: 70275
Summary: -w disables all -Werror flags
Product: gcc
Version: 5.3.0
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: c++
Assignee: unassigned at gcc dot gnu.org
Reporter: fuscated at gmail dot com
Target Milestone: ---
It happens with all versions I have access to (4.4.7, 4.8.x, 4.9.x, 5.3.0).
To reproduce:
> cat c++noreturn.cpp
int test() {}
int main() {
return 0;
}
> g++-5.3.0 c++noreturn.cpp -Werror=return-type
c++noreturn.cpp: In function ‘int test()’:
c++noreturn.cpp:1:13: error: no return statement in function returning non-void
[-Werror=return-type]
int test() {}
^
cc1plus: some warnings being treated as errors
>
> g++-5.3.0 c++noreturn.cpp -Werror=return-type -w
>
And the output of clang:
> clang++ c++noreturn.cpp -Werror=return-type -w
c++noreturn.cpp:1:13: error: control reaches end of non-void function
[-Werror,-Wreturn-type]
int test() {}
^
1 error generated.
For me the behaviour of clang is more predictable and the expected one.
Why we're disabling warnings is another matter. :)
More information about the Gcc-bugs
mailing list