diff options
author | Manuel López-Ibáñez <manu@gcc.gnu.org> | 2007-05-20 20:29:55 +0000 |
---|---|---|
committer | Manuel López-Ibáñez <manu@gcc.gnu.org> | 2007-05-20 20:29:55 +0000 |
commit | f6aa72dd497916b60e7a3c29e235241dadba3274 (patch) | |
tree | 90312ab1a9121fa6e7864a7b15bdaf3260ab1b8b /gcc/c-opts.c | |
parent | da5a2efd39b67a36c4e70f059ffbbb6103606f3e (diff) | |
download | gcc-f6aa72dd497916b60e7a3c29e235241dadba3274.tar.gz |
re PR middle-end/7651 (Define -Wextra strictly in terms of other warning flags)
2007-05-20 Manuel Lopez-Ibanez <manu@gcc.gnu.org>
PR middle-end/7651
PR c++/11856
PR c/12963
PR c/23587
PR other/29694
* c.opt (Wtype-limits): New.
* doc/invoke.texi (Wtype-limits): Document it.
(Wextra): Enabled by -Wextra.
* c-opts.c (c_common_post_options): Enabled by -Wextra.
* c-common.c (shorten_compare): Warn with Wtype-limits.
testsuite/
* gcc.dg/compare6.c: Replace Wall with Wtype-limits.
* gcc.dg/Wtype-limits.c: New.
* gcc.dg/Wtype-limits-Wextra.c: New.
* gcc.dg/Wtype-limits-no.c: New.
* g++.dg/warn/Wtype-limits.C: New.
* g++.dg/warn/Wtype-limits-Wextra.C: New.
* g++.dg/warn/Wtype-limits-no.C: New.
From-SVN: r124875
Diffstat (limited to 'gcc/c-opts.c')
-rw-r--r-- | gcc/c-opts.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/gcc/c-opts.c b/gcc/c-opts.c index 550059fa456..b11e671e49b 100644 --- a/gcc/c-opts.c +++ b/gcc/c-opts.c @@ -1059,10 +1059,13 @@ c_common_post_options (const char **pfilename) if (flag_objc_exceptions && !flag_objc_sjlj_exceptions) flag_exceptions = 1; - /* -Wextra implies -Wclobbered, -Wempty-body, -Wsign-compare, + /* -Wextra implies -Wtype-limits, -Wclobbered, + -Wempty-body, -Wsign-compare, -Wmissing-field-initializers, -Wmissing-parameter-type -Wold-style-declaration, and -Woverride-init, but not if explicitly overridden. */ + if (warn_type_limits == -1) + warn_type_limits = extra_warnings; if (warn_clobbered == -1) warn_clobbered = extra_warnings; if (warn_empty_body == -1) |