From mboxrd@z Thu Jan 1 00:00:00 1970 From: Jeffrey A Law To: Zack Weinberg Cc: egcs@egcs.cygnus.com Subject: Re: added: tests for uninit variable warnings Date: Wed, 31 Mar 1999 23:46:00 -0000 Message-ID: <4108.921199337@hurl.cygnus.com> References: <199903120010.TAA03507@blastula.phys.columbia.edu> X-SW-Source: 1999-03n/msg00438.html Message-ID: <19990331234600.FV6LKmBc3Ik584IpCcz9RyZI1W6wHnSFeN1D1ujvMJg@z> 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