aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorMarek Polacek <polacek@redhat.com>2013-12-05 22:51:11 +0000
committerMarek Polacek <mpolacek@gcc.gnu.org>2013-12-05 22:51:11 +0000
commit5ba505e708576b6b0e1b76d4662c078cf837d283 (patch)
tree0f28564a53d543397db6dad918d704d72fcc8fc6 /gcc
parent5cc2edcde433b1edff1699b372d5e70cc0690c88 (diff)
downloadgcc-5ba505e708576b6b0e1b76d4662c078cf837d283.zip
gcc-5ba505e708576b6b0e1b76d4662c078cf837d283.tar.gz
gcc-5ba505e708576b6b0e1b76d4662c078cf837d283.tar.bz2
invoke.texi: Document -fsanitize=signed-integer-overflow.
2013-12-05 Marek Polacek <polacek@redhat.com> * doc/invoke.texi: Document -fsanitize=signed-integer-overflow. From-SVN: r205721
Diffstat (limited to 'gcc')
-rw-r--r--gcc/ChangeLog4
-rw-r--r--gcc/doc/invoke.texi13
2 files changed, 17 insertions, 0 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index f1cd9b8..6f8c8f2 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,3 +1,7 @@
+2013-12-05 Marek Polacek <polacek@redhat.com>
+
+ * doc/invoke.texi: Document -fsanitize=signed-integer-overflow.
+
2013-12-05 H.J. Lu <hongjiu.lu@intel.com>
* config.gcc: Support --with-cpu=ia.
diff --git a/gcc/doc/invoke.texi b/gcc/doc/invoke.texi
index ed5b60f..cfb9b38 100644
--- a/gcc/doc/invoke.texi
+++ b/gcc/doc/invoke.texi
@@ -5363,6 +5363,19 @@ built with this option turned on will issue an error message
when the end of a non-void function is reached without actually
returning a value. This option works in C++ only.
+@item -fsanitize=signed-integer-overflow
+@opindex fsanitize=signed-integer-overflow
+
+This option enables signed integer overflow checking. We check that
+the result of @code{+}, @code{*}, and both unary and binary @code{-}
+does not overflow in the signed arithmetics. Note, integer promotion
+rules must be taken into account. That is, the following is not an
+overflow:
+@smallexample
+signed char a = SCHAR_MAX;
+a++;
+@end smallexample
+
@end table
While @option{-ftrapv} causes traps for signed overflows to be emitted,