| 1 |
/* { dg-options "-Wuninitialized" } */ |
| 2 |
|
| 3 |
/* Verify disabling a warning, where both the _Pragma and the |
| 4 |
affected code are within (different) macros. */ |
| 5 |
|
| 6 |
# define YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN \ |
| 7 |
_Pragma ("GCC diagnostic push") \ |
| 8 |
_Pragma ("GCC diagnostic ignored \"-Wuninitialized\"")\ |
| 9 |
_Pragma ("GCC diagnostic ignored \"-Wmaybe-uninitialized\"") |
| 10 |
# define YY_IGNORE_MAYBE_UNINITIALIZED_END \ |
| 11 |
_Pragma ("GCC diagnostic pop") |
| 12 |
|
| 13 |
#define WARNABLE_CODE *++yyvsp = yylval; /* { dg-bogus "used uninitialized" } */ |
| 14 |
|
| 15 |
void test (char yylval) |
| 16 |
{ |
| 17 |
char *yyvsp; /* { dg-bogus "declared here" } */ |
| 18 |
YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN |
| 19 |
WARNABLE_CODE |
| 20 |
YY_IGNORE_MAYBE_UNINITIALIZED_END |
| 21 |
} |