summaryrefslogtreecommitdiff
path: root/gcc/testsuite/gcc.dg/uninit-B-O0.c
blob: 5557ace6f8d02ab349c3f387288c6a99b5dcb8a4 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
/* Origin: PR c/179 from Gray Watson <gray@256.com>, adapted as a testcase
   by Joseph Myers <jsm28@cam.ac.uk>.  */
/* { dg-do compile } */
/* { dg-options "-Wuninitialized" } */
extern void foo (int *);
extern void bar (int);

void
baz (void)
{
  int i;
  if (i) /* { dg-warning "'i' is used uninitialized in this function" } */
    bar (i);
  foo (&i);
}