diff options
| author | ian <ian@138bc75d-0d04-0410-961f-82ee72b054a4> | 2007-03-09 17:59:47 +0000 |
|---|---|---|
| committer | ian <ian@138bc75d-0d04-0410-961f-82ee72b054a4> | 2007-03-09 17:59:47 +0000 |
| commit | 47fcc2588d605a4df307edc183c2b65636282a63 (patch) | |
| tree | f487bc84c561664f511afb0f6958dd9bda598520 | |
| parent | f2ea17013528841f2e521e4a500cc164ec1bedf6 (diff) | |
| download | ppe42-gcc-47fcc2588d605a4df307edc183c2b65636282a63.tar.gz ppe42-gcc-47fcc2588d605a4df307edc183c2b65636282a63.zip | |
* opts.c (common_handle_option): Treat -Wstrict-overflow (with no
argument) like -Wstrict-overflow=2.
* doc/invoke.texi (Warning Options): Update documentation.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@122753 138bc75d-0d04-0410-961f-82ee72b054a4
| -rw-r--r-- | gcc/ChangeLog | 6 | ||||
| -rw-r--r-- | gcc/doc/invoke.texi | 10 | ||||
| -rw-r--r-- | gcc/opts.c | 5 |
3 files changed, 16 insertions, 5 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 7bd6d741ea1..31d871a7ee1 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,9 @@ +2007-03-09 Ian Lance Taylor <iant@google.com> + + * opts.c (common_handle_option): Treat -Wstrict-overflow (with no + argument) like -Wstrict-overflow=2. + * doc/invoke.texi (Warning Options): Update documentation. + 2007-03-09 Dirk Mueller <dmueller@suse.de> PR c++/17946 diff --git a/gcc/doc/invoke.texi b/gcc/doc/invoke.texi index 98798844174..df9b160a7a6 100644 --- a/gcc/doc/invoke.texi +++ b/gcc/doc/invoke.texi @@ -3018,17 +3018,17 @@ warning levels are defined. @item -Wstrict-overflow=1 Warn about cases which are both questionable and easy to avoid. For example: @code{x + 1 > x}; with @option{-fstrict-overflow}, the -compiler will simplify this to @code{1}. @option{-Wstrict-overflow} -(with no level) is the same as @option{-Wstrict-overflow=1}. This -level of @option{-Wstrict-overflow} is enabled by @option{-Wall}; -higher levels are not, and must be explicitly requested. +compiler will simplify this to @code{1}. This level of +@option{-Wstrict-overflow} is enabled by @option{-Wall}; higher levels +are not, and must be explicitly requested. @item -Wstrict-overflow=2 Also warn about other cases where a comparison is simplified to a constant. For example: @code{abs (x) >= 0}. This can only be simplified when @option{-fstrict-overflow} is in effect, because @code{abs (INT_MIN)} overflows to @code{INT_MIN}, which is less than -zero. +zero. @option{-Wstrict-overflow} (with no level) is the same as +@option{-Wstrict-overflow=2}. @item -Wstrict-overflow=3 Also warn about other cases where a comparison is simplified. For diff --git a/gcc/opts.c b/gcc/opts.c index d3aea98ce98..ecbc9a39cbb 100644 --- a/gcc/opts.c +++ b/gcc/opts.c @@ -1094,6 +1094,11 @@ common_handle_option (size_t scode, const char *arg, int value, break; case OPT_Wstrict_overflow: + warn_strict_overflow = (value + ? (int) WARN_STRICT_OVERFLOW_CONDITIONAL + : 0); + break; + case OPT_Wstrict_overflow_: warn_strict_overflow = value; break; |

