diff options
author | Manuel López-Ibáñez <manu@gcc.gnu.org> | 2008-08-08 23:15:31 +0000 |
---|---|---|
committer | Manuel López-Ibáñez <manu@gcc.gnu.org> | 2008-08-08 23:15:31 +0000 |
commit | e73f7547c50e91654c691a620a949085645c4e51 (patch) | |
tree | 78d365c089bbd5db307fb058a73ce73b455dad1f /gcc/opts.c | |
parent | d40c9e333328e700c7a6f50f7e007dcd9dfcf84c (diff) | |
download | gcc-e73f7547c50e91654c691a620a949085645c4e51.zip gcc-e73f7547c50e91654c691a620a949085645c4e51.tar.gz gcc-e73f7547c50e91654c691a620a949085645c4e51.tar.bz2 |
re PR c/28875 ("-Wextra -Wno-unused-parameter -Wall" doesn't work as expected)
2008-08-08 Manuel Lopez-Ibanez <manu@gcc.gnu.org>
PR 28875
* flags.h (set_Wunused): Delete
* toplev.c (process_options): Handle Wunused flags here.
* opts.c (maybe_warn_unused_parameter): Delete.
(common_handle_option): Replace set_Wunused by warn_unused.
(set_Wextra): Do not handle Wunused-parameter here.
(set_Wunused): Delete.
* c-opts.c (c_common_handle_option): Replace set_Wunused by
warn_unused.
* common.opt (Wunused): Add Var and Init.
(Wunused-function): Likewise.
(Wunused-label): Likewise.
(Wunused-parameter): Likewise.
(Wunused-value): Likewise.
(Wunused-variable): Likewise.
fortran/
* options.c (set_Wall): Replace set_Wunused by warn_unused.
java/
* lang.c (java_handle_option): Replace set_Wunused with
warn_unused.
testsuite/
* gcc.dg/unused-6-no.c: New.
* gcc.dg/unused-6-WallWextra.c: New.
From-SVN: r138890
Diffstat (limited to 'gcc/opts.c')
-rw-r--r-- | gcc/opts.c | 23 |
1 files changed, 1 insertions, 22 deletions
@@ -63,9 +63,6 @@ HOST_WIDE_INT larger_than_size; bool warn_frame_larger_than; HOST_WIDE_INT frame_larger_than_size; -/* Hack for cooperation between set_Wunused and set_Wextra. */ -static bool maybe_warn_unused_parameter; - /* Type(s) of debugging information we are producing (if any). See flags.h for the definitions of the different possible types of debugging information. */ @@ -1667,7 +1664,7 @@ common_handle_option (size_t scode, const char *arg, int value, break; case OPT_Wunused: - set_Wunused (value); + warn_unused = value; break; case OPT_aux_info: @@ -2037,7 +2034,6 @@ static void set_Wextra (int setting) { extra_warnings = setting; - warn_unused_parameter = (setting && maybe_warn_unused_parameter); /* We save the value of warn_uninitialized, since if they put -Wuninitialized on the command line, we need to generate a @@ -2048,23 +2044,6 @@ set_Wextra (int setting) warn_uninitialized = 2; } -/* Initialize unused warning flags. */ -void -set_Wunused (int setting) -{ - warn_unused_function = setting; - warn_unused_label = setting; - /* Unused function parameter warnings are reported when either - ``-Wextra -Wunused'' or ``-Wunused-parameter'' is specified. - Thus, if -Wextra has already been seen, set warn_unused_parameter; - otherwise set maybe_warn_extra_parameter, which will be picked up - by set_Wextra. */ - maybe_warn_unused_parameter = setting; - warn_unused_parameter = (setting && extra_warnings); - warn_unused_variable = setting; - warn_unused_value = setting; -} - /* Used to set the level of strict aliasing warnings, when no level is specified (i.e., when -Wstrict-aliasing, and not -Wstrict-aliasing=level was given). |