summaryrefslogtreecommitdiff
path: root/gcc/c-parser.c
diff options
context:
space:
mode:
authormanu <manu@138bc75d-0d04-0410-961f-82ee72b054a4>2009-04-20 22:12:52 +0000
committermanu <manu@138bc75d-0d04-0410-961f-82ee72b054a4>2009-04-20 22:12:52 +0000
commit9ab71c6b292bda7d4826e8f20cf2c45dc0d86ba0 (patch)
treefd9591c53025bec4c451b0619535e1e5e33a2a4d /gcc/c-parser.c
parentd124a06aa30d5b842c7d5ee1db7f124931ae6f9a (diff)
downloadgcc-9ab71c6b292bda7d4826e8f20cf2c45dc0d86ba0.tar.gz
2009-04-21 Manuel Lopez-Ibanez <manu@gcc.gnu.org>
PR c++/13358 * doc/invoke.texi (-Wlong-long): Update description. * c-lex (interpret_integer): Only warn if there was no previous overflow and -Wlong-long is enabled. * c-decl.c (declspecs_add_type): Drop redundant flags. * c.opt (Wlong-long): Init to -1. * c-opts.c (sanitize_cpp_opts): Synchronize cpp's warn_long_long and front-end warn_long_long. Wlong-long only depends on other flags if it is uninitialized. * c-parser.c (disable_extension_diagnostics): warn_long_long is the same for CPP and FE. (restore_extension_diagnostics): Likewise. libcpp/ * init.c (cpp_create_reader): Wlong_long is disabled by default. * expr.c (cpp_classify_number): Give different messages for C and C++ front-ends. cp/ * parser.c (cp_parser_check_decl_spec): Drop redundant flags. * error.c (pedwarn_cxx98): New. * cp-tree.h (pedwarn_cxx98): Declare. testsuite/ * gcc.dg/wtr-int-type-1.c: Use two dg-warning to match two messages. Test for "long long" in system headers. * gcc.dg/c99-longlong-2.c: New. * g++.dg/warn/pr13358.C: New. * g++.dg/warn/pr13358-2.C: New. * g++.dg/warn/pr13358-3.C: New. * g++.dg/warn/pr13358-4.C: New. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@146459 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/c-parser.c')
-rw-r--r--gcc/c-parser.c9
1 files changed, 3 insertions, 6 deletions
diff --git a/gcc/c-parser.c b/gcc/c-parser.c
index e5129dce7e8..ca51d95eed5 100644
--- a/gcc/c-parser.c
+++ b/gcc/c-parser.c
@@ -818,14 +818,12 @@ disable_extension_diagnostics (void)
| (warn_pointer_arith << 1)
| (warn_traditional << 2)
| (flag_iso << 3)
- | (warn_long_long << 4)
- | (cpp_opts->warn_long_long << 5));
+ | (warn_long_long << 4));
cpp_opts->pedantic = pedantic = 0;
warn_pointer_arith = 0;
cpp_opts->warn_traditional = warn_traditional = 0;
flag_iso = 0;
- warn_long_long = 0;
- cpp_opts->warn_long_long = 0;
+ cpp_opts->warn_long_long = warn_long_long = 0;
return ret;
}
@@ -839,8 +837,7 @@ restore_extension_diagnostics (int flags)
warn_pointer_arith = (flags >> 1) & 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;
+ cpp_opts->warn_long_long = warn_long_long = (flags >> 4) & 1;
}
/* Possibly kinds of declarator to parse. */