aboutsummaryrefslogtreecommitdiff
path: root/gcc/c-opts.c
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/c-opts.c')
-rw-r--r--gcc/c-opts.c17
1 files changed, 9 insertions, 8 deletions
diff --git a/gcc/c-opts.c b/gcc/c-opts.c
index ece4d7f..4dffc78 100644
--- a/gcc/c-opts.c
+++ b/gcc/c-opts.c
@@ -1433,14 +1433,15 @@ sanitize_cpp_opts (void)
cpp_opts->unsigned_char = !flag_signed_char;
cpp_opts->stdc_0_in_system_headers = STDC_0_IN_SYSTEM_HEADERS;
- /* We want -Wno-long-long to override -pedantic -std=non-c99
- and/or -Wtraditional, whatever the ordering. */
- cpp_opts->warn_long_long
- = warn_long_long && ((pedantic
- && (c_dialect_cxx ()
- ? cxx_dialect == cxx98
- : !flag_isoc99))
- || warn_traditional);
+ /* Wlong-long is disabled by default. It is enabled by:
+ [-pedantic | -Wtraditional] -std=[gnu|c]++98 ; or
+ [-pedantic | -Wtraditional] -std=non-c99 .
+
+ Either -Wlong-long or -Wno-long-long override any other settings. */
+ if (warn_long_long == -1)
+ warn_long_long = ((pedantic || warn_traditional)
+ && (c_dialect_cxx () ? cxx_dialect == cxx98 : !flag_isoc99));
+ cpp_opts->warn_long_long = warn_long_long;
/* Similarly with -Wno-variadic-macros. No check for c99 here, since
this also turns off warnings about GCCs extension. */