From 5ba505e708576b6b0e1b76d4662c078cf837d283 Mon Sep 17 00:00:00 2001 From: Marek Polacek Date: Thu, 5 Dec 2013 22:51:11 +0000 Subject: [PATCH] invoke.texi: Document -fsanitize=signed-integer-overflow. 2013-12-05 Marek Polacek * doc/invoke.texi: Document -fsanitize=signed-integer-overflow. From-SVN: r205721 --- gcc/ChangeLog | 4 ++++ gcc/doc/invoke.texi | 13 +++++++++++++ 2 files changed, 17 insertions(+) diff --git a/gcc/ChangeLog b/gcc/ChangeLog index f1cd9b89765..6f8c8f2b01e 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,7 @@ +2013-12-05 Marek Polacek + + * doc/invoke.texi: Document -fsanitize=signed-integer-overflow. + 2013-12-05 H.J. Lu * config.gcc: Support --with-cpu=ia. diff --git a/gcc/doc/invoke.texi b/gcc/doc/invoke.texi index ed5b60f82a8..cfb9b38ed40 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,