analyzer: enable taint state machine by default [PR103533]
[official-gcc.git] / gcc / testsuite / c-c++-common / Warray-bounds-8.c
blob64202ddd5dfd9da6220f324548a9befda6f7ebaa
1 /* PR c/92326 - wrong bound in zero-length array diagnostics
2 { dg-do compile }
3 { dg-options "-O2 -Wall" } */
5 extern int a0[0];
6 extern int ax[];
8 void warn_global_array (void)
10 a0[0] = 0; // { dg-warning "array bounds of 'int *\\\[0]'" }
11 ax[-1] = 0; // { dg-warning "array bounds of 'int *\\\[]'" }
15 struct S0 { int n, a0[0]; } s0;
16 struct Sx { int n, ax[]; } sx = { 0 };
18 void warn_member_array (void)
20 s0.a0[0] = 0; // { dg-warning "array bounds of 'int *\\\[0]'" }
21 sx.ax[0] = 0; // { dg-warning "array bounds of 'int *\\\[]'" }