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

--- Comment #3 from Nir Aizik <niraizik at gmail dot com> ---
I think what make it counter-intuitive is that warning from valid option the
order of Werror is not important

example:
g++ -c -Wunused-variable -Werror test.cpp -o test.o
test.cpp: In function ‘int main(int, char**)’:
test.cpp:4:7: error: unused variable ‘i’ [-Werror=unused-variable]
   int i;
       ^
cc1plus: all warnings being treated as errors


g++ -c -Werror -Wunused-variable test.cpp -o test.o
test.cpp: In function ‘int main(int, char**)’:
test.cpp:4:7: error: unused variable ‘i’ [-Werror=unused-variable]
   int i;
       ^
cc1plus: all warnings being treated as errors


Another thing that is troubling is when there is 2 Werror, before and after, it
will output only warning

g++ -c -Werror -Wmissing-prototypes -Werror test.cpp -o test.o
cc1plus: warning: command line option ‘-Wmissing-prototypes’ is valid for
C/ObjC but not for C++

Reply via email to