]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
opts.c (common_handle_option): Treat -Wstrict-overflow (with no argument) like -Wstri...
authorIan Lance Taylor <iant@google.com>
Fri, 9 Mar 2007 17:59:47 +0000 (17:59 +0000)
committerIan Lance Taylor <ian@gcc.gnu.org>
Fri, 9 Mar 2007 17:59:47 +0000 (17:59 +0000)
* 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

gcc/ChangeLog
gcc/doc/invoke.texi
gcc/opts.c

index 7bd6d741ea151b4548e7907580d7e537abb077e7..31d871a7ee1f5ba709c0fbb201f0084abd0088f8 100644 (file)
@@ -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
index 987988441746a273926377b67a8c54d06fca5a9d..df9b160a7a655924e3eaf812704c46b28d3d762f 100644 (file)
@@ -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
index d3aea98ce98693c6e715c36fade7e290c36d830d..ecbc9a39cbba9e7807691519dcd457ffb3b787e1 100644 (file)
@@ -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;