annotate gcc/testsuite/c-c++-common/pr69543-4.c @ 111:04ced10e8804

gcc 7
author kono
date Fri, 27 Oct 2017 22:46:09 +0900
parents
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
111
kono
parents:
diff changeset
1 /* { dg-options "-Wuninitialized" } */
kono
parents:
diff changeset
2
kono
parents:
diff changeset
3 /* Verify disabling a warning, where both the _Pragma and the
kono
parents:
diff changeset
4 affected code are within (different) macros. */
kono
parents:
diff changeset
5
kono
parents:
diff changeset
6 /* TODO: XFAIL: both C and C++ erroneously fail to suppress the warning
kono
parents:
diff changeset
7 The warning is reported at the macro definition location, rather than
kono
parents:
diff changeset
8 the macro expansion location. */
kono
parents:
diff changeset
9
kono
parents:
diff changeset
10 # define YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN \
kono
parents:
diff changeset
11 _Pragma ("GCC diagnostic push") \
kono
parents:
diff changeset
12 _Pragma ("GCC diagnostic ignored \"-Wuninitialized\"")\
kono
parents:
diff changeset
13 _Pragma ("GCC diagnostic ignored \"-Wmaybe-uninitialized\"")
kono
parents:
diff changeset
14 # define YY_IGNORE_MAYBE_UNINITIALIZED_END \
kono
parents:
diff changeset
15 _Pragma ("GCC diagnostic pop")
kono
parents:
diff changeset
16
kono
parents:
diff changeset
17 #define WARNABLE_CODE *++yyvsp = yylval; /* { dg-bogus "used uninitialized" "" { xfail *-*-* } } */
kono
parents:
diff changeset
18
kono
parents:
diff changeset
19 void test (char yylval)
kono
parents:
diff changeset
20 {
kono
parents:
diff changeset
21 char *yyvsp; /* { dg-bogus "declared here" "" { xfail *-*-* } } */
kono
parents:
diff changeset
22 YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN
kono
parents:
diff changeset
23 WARNABLE_CODE
kono
parents:
diff changeset
24 YY_IGNORE_MAYBE_UNINITIALIZED_END
kono
parents:
diff changeset
25 }