Andreas Schwab wrote:
Scott Wood <[email protected]> writes:The problem is that GCC does not give an error (only a warning) even for things like this where it should be trivial to detect that the usage *is* uninitialized, not just might be: int foo(void) { int a; return a; }The compiler must not reject this code, because the undefined behavior only occurs if executed. There is no constraint violated.
Fine (though GCC could have something similar to -Werror but more limited in scope to the really serious stuff that *should* be illegal even if it isn't), but it should at least be a separate warning class.
My point was to counter Segher's assertion that the compiler currently gives an error on the obvious stuff.
-Scott _______________________________________________ Linuxppc-dev mailing list [email protected] https://ozlabs.org/mailman/listinfo/linuxppc-dev
