X-Git-Url: http://git.sourceforge.jp/view?a=blobdiff_plain;f=gcc%2Fopts.c;h=356f093192fe22004308274616f37507aab82fd4;hb=20c2121a1bd2f4e4d5edcd71ce48746c1fec4e04;hp=8cce46a2951e38a549c33590a3099c8f43d41a2f;hpb=66d9a7b9e8a0c85a51467330f51ead74e77b7eb8;p=pf3gnuchains%2Fgcc-fork.git diff --git a/gcc/opts.c b/gcc/opts.c index 8cce46a2951..356f093192f 100644 --- a/gcc/opts.c +++ b/gcc/opts.c @@ -382,7 +382,7 @@ maybe_default_option (struct gcc_options *opts, lang_mask, DK_UNSPECIFIED, loc, handlers, dc); else if (default_opt->arg == NULL - && !(option->flags & CL_REJECT_NEGATIVE)) + && !option->cl_reject_negative) handle_generated_option (opts, opts_set, default_opt->opt_index, default_opt->arg, !default_opt->value, lang_mask, DK_UNSPECIFIED, loc, @@ -807,6 +807,31 @@ finish_options (struct gcc_options *opts, struct gcc_options *opts_set, if (!opts->x_flag_tree_vectorize || !opts->x_flag_tree_loop_if_convert) maybe_set_param_value (PARAM_MAX_STORES_TO_SINK, 0, opts->x_param_values, opts_set->x_param_values); + + /* This replaces set_Wunused. */ + if (opts->x_warn_unused_function == -1) + opts->x_warn_unused_function = opts->x_warn_unused; + if (opts->x_warn_unused_label == -1) + opts->x_warn_unused_label = opts->x_warn_unused; + /* Wunused-parameter is enabled if both -Wunused -Wextra are enabled. */ + if (opts->x_warn_unused_parameter == -1) + opts->x_warn_unused_parameter = (opts->x_warn_unused + && opts->x_extra_warnings); + if (opts->x_warn_unused_variable == -1) + opts->x_warn_unused_variable = opts->x_warn_unused; + /* Wunused-but-set-parameter is enabled if both -Wunused -Wextra are + enabled. */ + if (opts->x_warn_unused_but_set_parameter == -1) + opts->x_warn_unused_but_set_parameter = (opts->x_warn_unused + && opts->x_extra_warnings); + if (opts->x_warn_unused_but_set_variable == -1) + opts->x_warn_unused_but_set_variable = opts->x_warn_unused; + if (opts->x_warn_unused_value == -1) + opts->x_warn_unused_value = opts->x_warn_unused; + + /* This replaces set_Wextra. */ + if (opts->x_warn_uninitialized == -1) + opts->x_warn_uninitialized = opts->x_extra_warnings; } #define LEFT_COLUMN 27 @@ -1680,6 +1705,11 @@ common_handle_option (struct gcc_options *opts, /* No-op. Used by the driver and passed to us because it starts with f.*/ break; + case OPT_Wuninitialized: + /* Also turn on maybe uninitialized warning. */ + warn_maybe_uninitialized = value; + break; + default: /* If the flag was handled in a standard way, assume the lack of processing here is intentional. */ @@ -1958,6 +1988,9 @@ 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); }