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
This commit is contained in:
Manuel López-Ibáñez 2012-05-17 11:50:37 +00:00
parent f330f5991e
commit 9b095bf15c
6 changed files with 33 additions and 30 deletions

View File

@ -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

View File

@ -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

View File

@ -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;

View File

@ -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

View File

@ -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"
}

View File

@ -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);
}