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
Wattributes-10.c: Add -fno-common option on hppa*-*-hpux*.
[official-gcc.git]
/
gcc
/
testsuite
/
c-c++-common
/
Wdangling-else-4.c
blob
12cc1405a40cc4b5b7a6eef2ca105672da043cee
1
/* { dg-do compile } */
2
/* { dg-options "-Wdangling-else" } */
3
4
void
bar
(
int
);
5
6
void
7
foo
(
int
a
,
int
b
,
int
c
)
8
{
9
if
(
a
)
/* { dg-warning "suggest explicit braces to avoid ambiguous .else." } */
10
switch
(
b
)
11
case
0
:
12
if
(
c
)
13
bar
(
1
);
14
else
15
bar
(
2
);
16
}
17
18
void
19
baz
(
int
a
,
int
b
,
int
c
)
20
{
21
if
(
a
)
22
switch
(
b
)
23
{
24
case
0
:
25
if
(
c
)
26
bar
(
1
);
27
}
28
else
29
bar
(
2
);
30
}
31