diff options
| -rw-r--r-- | gcc/ChangeLog | 4 | ||||
| -rw-r--r-- | gcc/doc/invoke.texi | 13 |
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, |
