summaryrefslogtreecommitdiff
path: root/gcc/c-parser.c
diff options
context:
space:
mode:
authormanu <manu@138bc75d-0d04-0410-961f-82ee72b054a4>2008-08-18 11:30:32 +0000
committermanu <manu@138bc75d-0d04-0410-961f-82ee72b054a4>2008-08-18 11:30:32 +0000
commitcaefd295852be695cdce0efd0bcfbd765339db2c (patch)
treea1b6b4f8b23e426f282ef94475efeba20d3aac5f /gcc/c-parser.c
parent2b9e35972efedbbbc594d278be0859a155a2274b (diff)
downloadgcc-caefd295852be695cdce0efd0bcfbd765339db2c.tar.gz
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. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@139194 138bc75d-0d04-0410-961f-82ee72b054a4
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 1ea9d07fcdf..ccec6602107 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. */