0

I have a thread but unfortunately none of the suggestions are working for me Make one gcc warning an error?

in my makefile i specify -Werror=uninitialized, no errors occur. I changed it to -Wuninitialized and i see my warning, -Wno-uninitialized makes it go away as expected, but why isnt -Werror=uninitialized working?

Also it was suggested in code i write

#pragma GCC diagnostic error "-Wuninitialized"

that does not work either. Why?

Community
  • 1
  • 1

2 Answers2

2

you should use -Werror

This option has no parameters (it is an on/off switch)

But it is good practice to remove all Warnings, so -Werror enforces this good practice.

Peter Miehle
  • 5,888
  • 2
  • 36
  • 53
1

What version of gcc are you using? Does that version support the -Werror=uninitialized command line option?

Greg Hewgill
  • 890,778
  • 177
  • 1,125
  • 1,260
  • this is the devkitpro modified mingw gcc. i am not sure how to check it but it does have std::tr1::shared_ptr in the headers. So far it appeared to be the same as normal gcc compilers. –  Jan 26 '09 at 07:24
  • Still, what version are you using? Use gcc -v to find out. – Martin v. Löwis Jan 26 '09 at 07:34