aboutsummaryrefslogtreecommitdiff
path: root/gcc/c-parser.c
diff options
context:
space:
mode:
authorManuel López-Ibáñez <manu@gcc.gnu.org>2008-08-18 11:30:32 +0000
committerManuel López-Ibáñez <manu@gcc.gnu.org>2008-08-18 11:30:32 +0000
commitd2e796ad5174fadb92878cee70cb5ee6e3a80df4 (patch)
treea1b6b4f8b23e426f282ef94475efeba20d3aac5f /gcc/c-parser.c
parentcbe5f3b371c07c282d48d135cc5041092e1de28d (diff)
downloadgcc-d2e796ad5174fadb92878cee70cb5ee6e3a80df4.zip
gcc-d2e796ad5174fadb92878cee70cb5ee6e3a80df4.tar.gz
gcc-d2e796ad5174fadb92878cee70cb5ee6e3a80df4.tar.bz2
re PR preprocessor/7263 (__extension__ keyword doesn't suppress warning on LL or ULL constants)
2008-08-18 Manuel Lopez-Ibanez <manu@gcc.gnu.org> PR cpp/7263 * c-opts.c (cpp_opts): Remove static. * c-parser.c (cpp_opts): Declare it extern. (disable_extension_diagnostics): Handle cpp options. (enable_extension_diagnostics): Likewise. testsuite/ * gcc.dg/cpp/pr7263-2.c: New. * gcc.dg/cpp/pr7263-2.h: New. * gcc.dg/cpp/pr7263-3.c: New. * gcc.dg/cpp/pr7263-3.h: New. From-SVN: r139194
Diffstat (limited to 'gcc/c-parser.c')
-rw-r--r--gcc/c-parser.c19
1 files changed, 14 insertions, 5 deletions
diff --git a/gcc/c-parser.c b/gcc/c-parser.c
index 1ea9d07..ccec660 100644
--- a/gcc/c-parser.c
+++ b/gcc/c-parser.c
@@ -805,6 +805,9 @@ c_parser_skip_to_end_of_block_or_statement (c_parser *parser)
parser->error = false;
}
+/* CPP's options (initialized by c-opts.c). */
+extern cpp_options *cpp_opts;
+
/* Save the warning flags which are controlled by __extension__. */
static inline int
@@ -813,11 +816,15 @@ disable_extension_diagnostics (void)
int ret = (pedantic
| (warn_pointer_arith << 1)
| (warn_traditional << 2)
- | (flag_iso << 3));
- pedantic = 0;
+ | (flag_iso << 3)
+ | (warn_long_long << 4)
+ | (cpp_opts->warn_long_long << 5));
+ cpp_opts->pedantic = pedantic = 0;
warn_pointer_arith = 0;
- warn_traditional = 0;
+ cpp_opts->warn_traditional = warn_traditional = 0;
flag_iso = 0;
+ warn_long_long = 0;
+ cpp_opts->warn_long_long = 0;
return ret;
}
@@ -827,10 +834,12 @@ disable_extension_diagnostics (void)
static inline void
restore_extension_diagnostics (int flags)
{
- pedantic = flags & 1;
+ cpp_opts->pedantic = pedantic = flags & 1;
warn_pointer_arith = (flags >> 1) & 1;
- warn_traditional = (flags >> 2) & 1;
+ cpp_opts->warn_traditional = warn_traditional = (flags >> 2) & 1;
flag_iso = (flags >> 3) & 1;
+ warn_long_long = (flags >> 4) & 1;
+ cpp_opts->warn_long_long = (flags >> 5) & 1;
}
/* Possibly kinds of declarator to parse. */