aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorManuel López-Ibáñez <manu@gcc.gnu.org>2012-05-17 11:50:37 +0000
committerManuel López-Ibáñez <manu@gcc.gnu.org>2012-05-17 11:50:37 +0000
commit9b095bf15cf5225b4223d33614d001cd44a501fc (patch)
tree9b9ef6fa3edd4dba37b6733c714b6a1103bd602c
parentf330f5991ef0182d59ab6b5b1c31f3bd5cb125ee (diff)
downloadgcc-9b095bf15cf5225b4223d33614d001cd44a501fc.zip
gcc-9b095bf15cf5225b4223d33614d001cd44a501fc.tar.gz
gcc-9b095bf15cf5225b4223d33614d001cd44a501fc.tar.bz2
c.opt (--pedantic-errors,-pedantic-errors): Do not handle here.
2012-05-17 Manuel López-Ibáñez <manu@gcc.gnu.org> c-family/ * c.opt (--pedantic-errors,-pedantic-errors): Do not handle here. * c-opts.c (c_common_handle_option): Do not handle explicitly Wreturn-type, Wwrite-strings, warn_ecpp, and -pedantic-errors. gcc/ * opts.c (common_handle_option): -pedantic-errors enables -Wpedantic. (enable_warning_as_error): Do not special case Wuninitialized. * optc-gen.awk: Add sanity checks. From-SVN: r187628
-rw-r--r--gcc/ChangeLog6
-rw-r--r--gcc/c-family/ChangeLog6
-rw-r--r--gcc/c-family/c-opts.c12
-rw-r--r--gcc/c-family/c.opt7
-rw-r--r--gcc/optc-gen.awk24
-rw-r--r--gcc/opts.c8
6 files changed, 33 insertions, 30 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index 65f76b4..425ebfd 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,3 +1,9 @@
+2012-05-17 Manuel López-Ibáñez <manu@gcc.gnu.org>
+
+ * opts.c (common_handle_option): -pedantic-errors enables -Wpedantic.
+ (enable_warning_as_error): Do not special case Wuninitialized.
+ * optc-gen.awk: Add sanity checks.
+
2012-05-17 Jan Hubicka <jh@suse.cz>
* ipa-reference.c (is_proper_for_analysis): Do not check flags
diff --git a/gcc/c-family/ChangeLog b/gcc/c-family/ChangeLog
index 0229a92..1a84751 100644
--- a/gcc/c-family/ChangeLog
+++ b/gcc/c-family/ChangeLog
@@ -1,3 +1,9 @@
+2012-05-17 Manuel López-Ibáñez <manu@gcc.gnu.org>
+
+ * c.opt (--pedantic-errors,-pedantic-errors): Do not handle here.
+ * c-opts.c (c_common_handle_option): Do not handle explicitly
+ Wreturn-type, Wwrite-strings, warn_ecpp, and -pedantic-errors.
+
2012-05-16 Dodji Seketeli <dodji@redhat.com>
PR preprocessor/7263
diff --git a/gcc/c-family/c-opts.c b/gcc/c-family/c-opts.c
index a7fadc8..c493c10 100644
--- a/gcc/c-family/c-opts.c
+++ b/gcc/c-family/c-opts.c
@@ -510,10 +510,6 @@ c_common_handle_option (size_t scode, const char *arg, int value,
break;
}
- case OPT_Wreturn_type:
- warn_return_type = value;
- break;
-
case OPT_Wtraditional:
cpp_opts->cpp_warn_traditional = value;
break;
@@ -540,12 +536,7 @@ c_common_handle_option (size_t scode, const char *arg, int value,
warn_variadic_macros = value;
break;
- case OPT_Wwrite_strings:
- warn_write_strings = value;
- break;
-
case OPT_Weffc__:
- warn_ecpp = value;
if (value)
warn_nonvdtor = true;
break;
@@ -740,10 +731,9 @@ c_common_handle_option (size_t scode, const char *arg, int value,
error ("output filename specified twice");
break;
- /* We need to handle the -Wpedantic switches here, rather than in
+ /* We need to handle the -Wpedantic switch here, rather than in
c_common_post_options, so that a subsequent -Wno-endif-labels
is not overridden. */
- case OPT_pedantic_errors:
case OPT_Wpedantic:
cpp_opts->cpp_pedantic = 1;
cpp_opts->warn_endif_labels = 1;
diff --git a/gcc/c-family/c.opt b/gcc/c-family/c.opt
index 0f13dc3..53d9752 100644
--- a/gcc/c-family/c.opt
+++ b/gcc/c-family/c.opt
@@ -142,9 +142,6 @@ C ObjC C++ ObjC++ Joined Separate
-pedantic
C ObjC C++ ObjC++ Alias(pedantic)
--pedantic-errors
-C ObjC C++ ObjC++ Alias(pedantic-errors)
-
-preprocess
C ObjC C++ ObjC++ Undocumented Alias(E)
@@ -1203,10 +1200,6 @@ pedantic
C ObjC C++ ObjC++ Alias(Wpedantic)
; Documented in common.opt
-pedantic-errors
-C ObjC C++ ObjC++
-; Documented in common.opt
-
print-objc-runtime-info
ObjC ObjC++
Generate C header of platform-specific features
diff --git a/gcc/optc-gen.awk b/gcc/optc-gen.awk
index 1d46a5d..0abe6bc 100644
--- a/gcc/optc-gen.awk
+++ b/gcc/optc-gen.awk
@@ -391,10 +391,14 @@ for (i = 0; i < n_enabledby; i++) {
n_enables = split(enables[enabledby_name], thisenable, ",");
for (j = 1; j < n_enables; j++) {
opt_var_name = var_name(flags[opt_numbers[thisenable[j]]]);
- print " if (!opts_set->x_" opt_var_name ")"
- print " handle_generated_option (opts, opts_set,"
- print " " opt_enum(thisenable[j]) ", NULL, value,"
- print " lang_mask, kind, loc, handlers, dc);"
+ if (opt_var_name != "") {
+ print " if (!opts_set->x_" opt_var_name ")"
+ print " handle_generated_option (opts, opts_set,"
+ print " " opt_enum(thisenable[j]) ", NULL, value,"
+ print " lang_mask, kind, loc, handlers, dc);"
+ } else {
+ print "#error " thisenable[j] " does not have a Var() flag"
+ }
}
print " break;\n"
}
@@ -430,10 +434,14 @@ for (i = 0; i < n_langs; i++) {
n_enables = split(enables[lang_name,enabledby_name], thisenable, ",");
for (j = 1; j < n_enables; j++) {
opt_var_name = var_name(flags[opt_numbers[thisenable[j]]]);
- print " if (!opts_set->x_" opt_var_name ")"
- print " handle_generated_option (opts, opts_set,"
- print " " opt_enum(thisenable[j]) ", arg, value,"
- print " lang_mask, kind, loc, handlers, dc);"
+ if (opt_var_name != "") {
+ print " if (!opts_set->x_" opt_var_name ")"
+ print " handle_generated_option (opts, opts_set,"
+ print " " opt_enum(thisenable[j]) ", arg, value,"
+ print " lang_mask, kind, loc, handlers, dc);"
+ } else {
+ print "#error " thisenable[j] " does not have a Var() flag"
+ }
}
print " break;\n"
}
diff --git a/gcc/opts.c b/gcc/opts.c
index ac43d4a..58199c3 100644
--- a/gcc/opts.c
+++ b/gcc/opts.c
@@ -1712,8 +1712,11 @@ common_handle_option (struct gcc_options *opts,
break;
case OPT_pedantic_errors:
- opts->x_pedantic = 1;
dc->pedantic_errors = 1;
+ control_warning_option (OPT_Wpedantic, DK_ERROR, value,
+ loc, lang_mask,
+ handlers, opts, opts_set,
+ dc);
break;
case OPT_flto:
@@ -2012,9 +2015,6 @@ enable_warning_as_error (const char *arg, int value, unsigned int lang_mask,
control_warning_option (option_index, (int) kind, value,
loc, lang_mask,
handlers, opts, opts_set, dc);
- if (option_index == OPT_Wuninitialized)
- enable_warning_as_error ("maybe-uninitialized", value, lang_mask,
- handlers, opts, opts_set, loc, dc);
}
free (new_option);
}