1 /* PR middle-end/92312 - bogus -Wstringop-overflow storing into a trailing
2 array backed by larger buffer
4 { dg-options "-O2 -fno-tree-vectorize -Wall -Wno-array-bounds" } */
6 struct S0
{ char a
, b
[0]; };
10 void test_store_zero_length (int i
)
13 struct S0
*p
= (struct S0
*)a
;
16 p
->b
[1] = 1; // { dg-bogus "\\\[-Wstringop-overflow" }
17 p
->b
[2] = 2; // { dg-warning "\\\[-Wstringop-overflow" }
22 struct Sx
{ char a
, b
[]; };
24 void test_store_flexarray (int i
)
27 struct Sx
*p
= (struct Sx
*)a
;
30 p
->b
[1] = 1; // { dg-bogus "\\\[-Wstringop-overflow" }
31 p
->b
[2] = 1; // { dg-warning "\\\[-Wstringop-overflow" }