0

In my makefile I specify -Werror=uninitialized, but no errors occur.

I changed it to -Wuninitialized, and I see my warning. -Wno-uninitialized makes it go away as expected, but why isn’t -Werror=uninitialized working?

Also it was suggested in code I write

#pragma GCC diagnostic error "-Wuninitialized"

But that does not work either. Why?

I have another question, but unfortunately none of the suggestions are working for me.

Peter Mortensen
  • 30,738
  • 21
  • 105
  • 131

1 Answers1

2

You should use -Werror. This option doesn't have any parameters (it is an on/off switch).

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

Peter Mortensen
  • 30,738
  • 21
  • 105
  • 131
Peter Miehle
  • 5,984
  • 2
  • 38
  • 55