aboutsummaryrefslogtreecommitdiff
path: root/gcc/opts.c
diff options
context:
space:
mode:
authorJoseph Myers <joseph@codesourcery.com>2011-05-11 12:11:34 +0100
committerJoseph Myers <jsm28@gcc.gnu.org>2011-05-11 12:11:34 +0100
commite9f8dcf9b3bd2972c947d793443a83a78104ae87 (patch)
treebabd79b10257fe88a1745042a232ee7ddf2e50cc /gcc/opts.c
parent10c224a9b0780fe3ae5d83a588046887203f2285 (diff)
downloadgcc-e9f8dcf9b3bd2972c947d793443a83a78104ae87.zip
gcc-e9f8dcf9b3bd2972c947d793443a83a78104ae87.tar.gz
gcc-e9f8dcf9b3bd2972c947d793443a83a78104ae87.tar.bz2
opts.c (finish_options): Move warning settings from process_options.
* opts.c (finish_options): Move warning settings from process_options. * toplev.c (process_options): Move warning settings to finish_options. From-SVN: r173651
Diffstat (limited to 'gcc/opts.c')
-rw-r--r--gcc/opts.c25
1 files changed, 25 insertions, 0 deletions
diff --git a/gcc/opts.c b/gcc/opts.c
index f00e1b2..356f093 100644
--- a/gcc/opts.c
+++ b/gcc/opts.c
@@ -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