view gcc/testsuite/gcc.dg/uninit-pr81782.c @ 131:84e7813d76e9

gcc-8.2
author mir3636
date Thu, 25 Oct 2018 07:37:49 +0900
parents
children
line wrap: on
line source

/* { 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;
}