[llvm-commits] -Wno-maybe-uninitialized not working right with gcc-4.3

dag at cray.com dag at cray.com
Tue Jan 15 08:48:11 PST 2013


Duncan Sands <baldrick at free.fr> writes:

> Hi David, your -Wno-maybe-uninitialized changes broke one of my buildbots.
> The reason is that gcc-4.3 accepts this flag, however if any kind of warning
> is produced then it errors out saying it doesn't know -Wno-maybe-uninitialized.
>
> For example, suppose empty.cpp is an empty file, and warn.cpp contains:
>
>   int foo(int x, unsigned y) {
>     return x == y;
>   }
>
> Then:
>
> $ gcc -S empty.cpp -Wall -Wno-maybe-uninitialized
> $ gcc -S warn.cpp -Wall -Wno-maybe-uninitialized
> warn.cpp: In function ‘int foo(int, unsigned int)’:
> warn.cpp:2: warning: comparison between signed and unsigned integer expressions
> At global scope:
> cc1plus: error: unrecognized command line option "-Wno-maybe-uninitialized"
> $
>
> This is clearly a gcc bug.  I don't know what the right approach to solving
> this is though, any suggestions?

Grr...I wonder if this is a general problem with pre-4.6 gcc or only
this specific version.

I could check the gcc version and if it is pre-4.7 use
-Wno-uninitialized.

                                   -David




More information about the llvm-commits mailing list