111
|
1 /* { dg-options "-Wuninitialized" } */
|
|
2
|
|
3 /* Verify disabling a warning, where the _Pragma is in regular code,
|
|
4 but the affected code is within a macro. */
|
|
5
|
|
6 /* TODO: XFAIL: both C and C++ erroneously fail to suppress the warning
|
|
7 The warning is reported at the macro definition location, rather than
|
|
8 the macro expansion location. */
|
|
9
|
|
10 #define WARNABLE_CODE *++yyvsp = yylval; /* { dg-bogus "used uninitialized" "" { xfail *-*-* } } */
|
|
11
|
|
12 void test (char yylval)
|
|
13 {
|
|
14 char *yyvsp; /* { dg-bogus "declared here" "" { xfail *-*-* } } */
|
|
15 _Pragma ("GCC diagnostic push")
|
|
16 _Pragma ("GCC diagnostic ignored \"-Wuninitialized\"")
|
|
17 _Pragma ("GCC diagnostic ignored \"-Wmaybe-uninitialized\"")
|
|
18 WARNABLE_CODE
|
|
19 _Pragma ("GCC diagnostic pop")
|
|
20 }
|