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
parent f330f599
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> 2012-05-17 Jan Hubicka <jh@suse.cz>
* ipa-reference.c (is_proper_for_analysis): Do not check flags * ipa-reference.c (is_proper_for_analysis): Do not check flags
......
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> 2012-05-16 Dodji Seketeli <dodji@redhat.com>
PR preprocessor/7263 PR preprocessor/7263
......
...@@ -510,10 +510,6 @@ c_common_handle_option (size_t scode, const char *arg, int value, ...@@ -510,10 +510,6 @@ c_common_handle_option (size_t scode, const char *arg, int value,
break; break;
} }
case OPT_Wreturn_type:
warn_return_type = value;
break;
case OPT_Wtraditional: case OPT_Wtraditional:
cpp_opts->cpp_warn_traditional = value; cpp_opts->cpp_warn_traditional = value;
break; break;
...@@ -540,12 +536,7 @@ c_common_handle_option (size_t scode, const char *arg, int value, ...@@ -540,12 +536,7 @@ c_common_handle_option (size_t scode, const char *arg, int value,
warn_variadic_macros = value; warn_variadic_macros = value;
break; break;
case OPT_Wwrite_strings:
warn_write_strings = value;
break;
case OPT_Weffc__: case OPT_Weffc__:
warn_ecpp = value;
if (value) if (value)
warn_nonvdtor = true; warn_nonvdtor = true;
break; break;
...@@ -740,10 +731,9 @@ c_common_handle_option (size_t scode, const char *arg, int value, ...@@ -740,10 +731,9 @@ c_common_handle_option (size_t scode, const char *arg, int value,
error ("output filename specified twice"); error ("output filename specified twice");
break; 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 c_common_post_options, so that a subsequent -Wno-endif-labels
is not overridden. */ is not overridden. */
case OPT_pedantic_errors:
case OPT_Wpedantic: case OPT_Wpedantic:
cpp_opts->cpp_pedantic = 1; cpp_opts->cpp_pedantic = 1;
cpp_opts->warn_endif_labels = 1; cpp_opts->warn_endif_labels = 1;
......
...@@ -142,9 +142,6 @@ C ObjC C++ ObjC++ Joined Separate ...@@ -142,9 +142,6 @@ C ObjC C++ ObjC++ Joined Separate
-pedantic -pedantic
C ObjC C++ ObjC++ Alias(pedantic) C ObjC C++ ObjC++ Alias(pedantic)
-pedantic-errors
C ObjC C++ ObjC++ Alias(pedantic-errors)
-preprocess -preprocess
C ObjC C++ ObjC++ Undocumented Alias(E) C ObjC C++ ObjC++ Undocumented Alias(E)
...@@ -1203,10 +1200,6 @@ pedantic ...@@ -1203,10 +1200,6 @@ pedantic
C ObjC C++ ObjC++ Alias(Wpedantic) C ObjC C++ ObjC++ Alias(Wpedantic)
; Documented in common.opt ; Documented in common.opt
pedantic-errors
C ObjC C++ ObjC++
; Documented in common.opt
print-objc-runtime-info print-objc-runtime-info
ObjC ObjC++ ObjC ObjC++
Generate C header of platform-specific features Generate C header of platform-specific features
......
...@@ -391,10 +391,14 @@ for (i = 0; i < n_enabledby; i++) { ...@@ -391,10 +391,14 @@ for (i = 0; i < n_enabledby; i++) {
n_enables = split(enables[enabledby_name], thisenable, ","); n_enables = split(enables[enabledby_name], thisenable, ",");
for (j = 1; j < n_enables; j++) { for (j = 1; j < n_enables; j++) {
opt_var_name = var_name(flags[opt_numbers[thisenable[j]]]); opt_var_name = var_name(flags[opt_numbers[thisenable[j]]]);
print " if (!opts_set->x_" opt_var_name ")" if (opt_var_name != "") {
print " handle_generated_option (opts, opts_set," print " if (!opts_set->x_" opt_var_name ")"
print " " opt_enum(thisenable[j]) ", NULL, value," print " handle_generated_option (opts, opts_set,"
print " lang_mask, kind, loc, handlers, dc);" 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" print " break;\n"
} }
...@@ -430,10 +434,14 @@ for (i = 0; i < n_langs; i++) { ...@@ -430,10 +434,14 @@ for (i = 0; i < n_langs; i++) {
n_enables = split(enables[lang_name,enabledby_name], thisenable, ","); n_enables = split(enables[lang_name,enabledby_name], thisenable, ",");
for (j = 1; j < n_enables; j++) { for (j = 1; j < n_enables; j++) {
opt_var_name = var_name(flags[opt_numbers[thisenable[j]]]); opt_var_name = var_name(flags[opt_numbers[thisenable[j]]]);
print " if (!opts_set->x_" opt_var_name ")" if (opt_var_name != "") {
print " handle_generated_option (opts, opts_set," print " if (!opts_set->x_" opt_var_name ")"
print " " opt_enum(thisenable[j]) ", arg, value," print " handle_generated_option (opts, opts_set,"
print " lang_mask, kind, loc, handlers, dc);" 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" print " break;\n"
} }
......
...@@ -1712,8 +1712,11 @@ common_handle_option (struct gcc_options *opts, ...@@ -1712,8 +1712,11 @@ common_handle_option (struct gcc_options *opts,
break; break;
case OPT_pedantic_errors: case OPT_pedantic_errors:
opts->x_pedantic = 1;
dc->pedantic_errors = 1; dc->pedantic_errors = 1;
control_warning_option (OPT_Wpedantic, DK_ERROR, value,
loc, lang_mask,
handlers, opts, opts_set,
dc);
break; break;
case OPT_flto: case OPT_flto:
...@@ -2012,9 +2015,6 @@ enable_warning_as_error (const char *arg, int value, unsigned int lang_mask, ...@@ -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, control_warning_option (option_index, (int) kind, value,
loc, lang_mask, loc, lang_mask,
handlers, opts, opts_set, dc); 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); free (new_option);
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment