------- Comment #3 from jakub at gcc dot gnu dot org 2010-07-26 18:50 -------
Reduced testcase:
/* { dg-do compile } */
/* { dg-options "-O2 -Wuninitialized" } */
struct S { char *a; unsigned b; unsigned c; };
extern int foo (const char *);
extern void bar (int, int);
static void
baz (void)
{
struct S cs[1];
switch (cs->b) /* { dg-warning "cs\\[^\n\r\\]\.b\\[^\n\r\\]is used
uninitialized" } */
{
case 101:
if (foo (cs->a)) /* { dg-warning "cs\\[^\n\r\\]\.a\\[^\n\r\\]may be used
uninitialized" } */
bar (cs->c, cs->b); /* { dg-warning "cs\\[^\n\r\\]\.c\\[^\n\r\\]may be
used uninitialized" } */
}
}
void
test (void)
{
baz ();
}
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=45083