diagnostics: remove duplicate copies of diagnostic_kind_text
[official-gcc.git] / gcc / testsuite / gcc.dg / Warray-bounds-18.c
blob092363aea31c8537a23423acb2e4f84e6341149b
1 /* { dg-do compile } */
2 /* { dg-options "-O2 -Warray-bounds -Wno-stringop-overflow" } */
4 typedef struct
6 int len;
7 char data[1];
8 } rec;
10 int
11 p(rec *r, int len);
13 int
14 f (char prm1, char prm2)
16 char buf[10];
18 rec *r1 = (rec *)&buf;
20 r1->len = 10;
21 r1->data[0] = prm1;
22 r1->data[1] = prm2; /* { dg-bogus "above array bounds" } */
24 return p(r1, r1->len);