summaryrefslogtreecommitdiff
path: root/gcc/testsuite/gcc.dg/uninit-pr81782.c
blob: 7d1e90203f0019675a45c4b1472a7a105563f9ff (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
/* { dg-do compile } */
/* { dg-options "-Wmaybe-uninitialized" } */

int
foo (void)
{
  char empty_array[] = { };
  int i, ret = 0;

  for (i = 0; i < (int) (sizeof (empty_array) / sizeof (empty_array[0])); i++)
    ret = empty_array[i]; /* { dg-bogus "uninitialized" } */

  return ret;
}