Wattributes-10.c: Add -fno-common option on hppa*-*-hpux*.
[official-gcc.git] / gcc / testsuite / c-c++-common / Wdangling-else-4.c
blob12cc1405a40cc4b5b7a6eef2ca105672da043cee
1 /* { dg-do compile } */
2 /* { dg-options "-Wdangling-else" } */
4 void bar (int);
6 void
7 foo (int a, int b, int c)
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);
18 void
19 baz (int a, int b, int c)
21 if (a)
22 switch (b)
24 case 0:
25 if (c)
26 bar (1);
28 else
29 bar (2);