added: tests for uninit variable warnings
Jeffrey A Law
law@hurl.cygnus.com
Wed Mar 31 23:46:00 GMT 1999
In message < 199903120010.TAA03507@blastula.phys.columbia.edu >you write:
> uninit-4.c is bizarre: the warning goes away if you remove the '1'
> case, or if you replace 'struct operation' by an int, or even if you
> make 'struct operation' smaller! Also, if you take out the default
> case _and_ the '1' case, the warning goes away, but it shouldn't (what
> if cpp_lex returns 3?)
Not weird at all. Changing the numberof cases or density of the switch may
cause the compiler to emit it as a series of cascaded if/else statements which
the compiler is better able to analyze.
Structures also present some interesting problems to the uninitialized
variable analysis. It's quite a bit more difficult for the compiler to
determine that an entire structure has been initialized as opposed to a simple
integer or floating point variable.
> The tests are marked XFAIL - all systems. I'm interested to know if
> they pass on anyone's machine.
They probably will pass on some machines because of differences in switch
table density threshholds (at least uninit-4)
jeff
More information about the Gcc
mailing list