+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
+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
break;
}
- case OPT_Wreturn_type:
- warn_return_type = value;
- break;
-
case OPT_Wtraditional:
cpp_opts->cpp_warn_traditional = value;
break;
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;
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;
-pedantic
C ObjC C++ ObjC++ Alias(pedantic)
--pedantic-errors
-C ObjC C++ ObjC++ Alias(pedantic-errors)
-
-preprocess
C ObjC C++ ObjC++ Undocumented Alias(E)
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
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"
}
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"
}
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:
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);
}