Commit 4d4362c8 by Ian Lance Taylor Committed by Ian Lance Taylor

opts.c (common_handle_option): Treat -Wstrict-overflow (with no argument) like -Wstrict-overflow=2.

	* opts.c (common_handle_option): Treat -Wstrict-overflow (with no
	argument) like -Wstrict-overflow=2.
	* doc/invoke.texi (Warning Options): Update documentation.

From-SVN: r122753
parent 9645c3c5
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> 2007-03-09 Dirk Mueller <dmueller@suse.de>
PR c++/17946 PR c++/17946
......
...@@ -3018,17 +3018,17 @@ warning levels are defined. ...@@ -3018,17 +3018,17 @@ warning levels are defined.
@item -Wstrict-overflow=1 @item -Wstrict-overflow=1
Warn about cases which are both questionable and easy to avoid. For Warn about cases which are both questionable and easy to avoid. For
example: @code{x + 1 > x}; with @option{-fstrict-overflow}, the example: @code{x + 1 > x}; with @option{-fstrict-overflow}, the
compiler will simplify this to @code{1}. @option{-Wstrict-overflow} compiler will simplify this to @code{1}. This level of
(with no level) is the same as @option{-Wstrict-overflow=1}. This @option{-Wstrict-overflow} is enabled by @option{-Wall}; higher levels
level of @option{-Wstrict-overflow} is enabled by @option{-Wall}; are not, and must be explicitly requested.
higher levels are not, and must be explicitly requested.
@item -Wstrict-overflow=2 @item -Wstrict-overflow=2
Also warn about other cases where a comparison is simplified to a Also warn about other cases where a comparison is simplified to a
constant. For example: @code{abs (x) >= 0}. This can only be constant. For example: @code{abs (x) >= 0}. This can only be
simplified when @option{-fstrict-overflow} is in effect, because simplified when @option{-fstrict-overflow} is in effect, because
@code{abs (INT_MIN)} overflows to @code{INT_MIN}, which is less than @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 @item -Wstrict-overflow=3
Also warn about other cases where a comparison is simplified. For Also warn about other cases where a comparison is simplified. For
......
...@@ -1094,6 +1094,11 @@ common_handle_option (size_t scode, const char *arg, int value, ...@@ -1094,6 +1094,11 @@ common_handle_option (size_t scode, const char *arg, int value,
break; break;
case OPT_Wstrict_overflow: case OPT_Wstrict_overflow:
warn_strict_overflow = (value
? (int) WARN_STRICT_OVERFLOW_CONDITIONAL
: 0);
break;
case OPT_Wstrict_overflow_: case OPT_Wstrict_overflow_:
warn_strict_overflow = value; warn_strict_overflow = value;
break; break;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment