summaryrefslogtreecommitdiff
path: root/gcc/opts.c
diff options
context:
space:
mode:
authordodji <dodji@138bc75d-0d04-0410-961f-82ee72b054a4>2012-05-04 16:38:27 +0000
committerdodji <dodji@138bc75d-0d04-0410-961f-82ee72b054a4>2012-05-04 16:38:27 +0000
commite163935c9d756c0a00c9750ccbe55be840d17447 (patch)
tree2a313c2ba5c867797cc1b623c7f4bdc0fc018b08 /gcc/opts.c
parent69f685c0a62f821809451986700a51b96266d53b (diff)
downloadgcc-e163935c9d756c0a00c9750ccbe55be840d17447.tar.gz
Enable -Wunused-local-typedefs when -Wall or -Wunused is on
Now that the libstdc++ testsuite is run with -ftrack-macro-location by default, this patch triggers the -Wunused-local-typedefs warning when -Wunused (and -Wall) is turned on. The patch has been reviewed and accepted[1] a while ago, but was waiting for the -ftrack-macro-expansion work to go in first. Bootstrapped and tested again on x86_64-unknown-linux-gnu against trunk. Applied to the mainline. [1]: http://gcc.gnu.org/ml/gcc-patches/2011-09/msg00605.html gcc/ * opts.c (finish_options): Activate -Wunused-local-typedefs if -Wunused is activated. * doc/invoke.texi: Update blurb of -Wunused-local-typedefs. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@187167 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/opts.c')
-rw-r--r--gcc/opts.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/gcc/opts.c b/gcc/opts.c
index 22c7590f1bd..b6c786f950e 100644
--- a/gcc/opts.c
+++ b/gcc/opts.c
@@ -835,6 +835,10 @@ finish_options (struct gcc_options *opts, struct gcc_options *opts_set,
if (opts->x_warn_unused_value == -1)
opts->x_warn_unused_value = opts->x_warn_unused;
+ /* Wunused-local-typedefs is enabled by -Wunused or -Wall. */
+ if (opts->x_warn_unused_local_typedefs == -1)
+ opts->x_warn_unused_local_typedefs = opts->x_warn_unused;
+
/* This replaces set_Wextra. */
if (opts->x_warn_uninitialized == -1)
opts->x_warn_uninitialized = opts->x_extra_warnings;