repo.or.cz
/
official-gcc.git
/
blob
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
log
|
graphiclog1
|
graphiclog2
|
commit
|
commitdiff
|
tree
|
refs
|
edit
|
fork
blame
|
history
|
raw
|
HEAD
libcpp, c, middle-end: Optimize initializers using #embed in C
[official-gcc.git]
/
gcc
/
testsuite
/
gcc.dg
/
Warray-bounds-17.c
blob
e790037feb15aaa12041ef0b1c53036bc072b194
1
/* { dg-do compile } */
2
/* { dg-options "-O2 -Warray-bounds" } */
3
4
char
*
y
;
5
void
foo
(
int
sysnum
)
6
{
7
static char
*
x
[] = {};
8
int
nsyscalls
=
sizeof
x
/
sizeof
x
[
0
];
9
if
(
sysnum
<
0
||
sysnum
>=
nsyscalls
)
10
return
;
11
else
12
y
=
x
[
sysnum
];
/* { dg-bogus "above array bounds" } */
13
}