Mercurial > hg > CbC > CbC_gcc
comparison gcc/testsuite/gcc.dg/Wstringop-overflow-16.c @ 145:1830386684a0
gcc-9.2.0
author | anatofuz |
---|---|
date | Thu, 13 Feb 2020 11:34:05 +0900 |
parents | |
children |
comparison
equal
deleted
inserted
replaced
131:84e7813d76e9 | 145:1830386684a0 |
---|---|
1 /* PR middle-end/91599 - GCC does not say where warning is happening | |
2 { dg-do compile } | |
3 { dg-options "-O2 -Wall" } */ | |
4 | |
5 struct charseq { | |
6 unsigned char bytes[0]; // { dg-message "while referencing|object declared here" } | |
7 }; | |
8 | |
9 struct locale_ctype_t { | |
10 struct charseq *mboutdigits[10]; | |
11 }; | |
12 | |
13 void ctype_finish (struct locale_ctype_t *ctype) | |
14 { | |
15 long unsigned int cnt; | |
16 for (cnt = 0; cnt < 20; ++cnt) { | |
17 static struct charseq replace[2]; | |
18 replace[0].bytes[1] = '\0'; // { dg-warning "\\\[-Warray-bounds|-Wstringop-overflow" } | |
19 ctype->mboutdigits[cnt] = &replace[0]; | |
20 } | |
21 } |