blob: 74548a4f0fa35bc5c6bd18877c6b1ac610d83208 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
|
/* PR middle-end/91599 - GCC does not say where warning is happening
{ dg-do compile }
{ dg-options "-O2 -Wall" } */
struct charseq {
unsigned char bytes[0]; // { dg-message "object declared here" }
};
struct locale_ctype_t {
struct charseq *mboutdigits[10];
};
void ctype_finish (struct locale_ctype_t *ctype)
{
long unsigned int cnt;
for (cnt = 0; cnt < 20; ++cnt) {
static struct charseq replace[2];
replace[0].bytes[1] = '\0'; // { dg-warning "\\\[-Wstringop-overflow" }
ctype->mboutdigits[cnt] = &replace[0];
}
}
|