This is the mail archive of the mailing list for the GCC project.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[PATCH, doc] Document -fsanitize=signed-integer-overflow

As promised, this patch on top of this patch by Tobias:
adds the documentation for -fsanitize=signed-integer-overflow.

Ok to install after the actual implementation is in?

2013-11-28  Marek Polacek  <>

	* doc/invoke.texi: Document -fsanitize=signed-integer-overflow.

--- gcc/doc/invoke.texi.mp3	2013-11-28 13:07:09.011575348 +0100
+++ gcc/doc/invoke.texi	2013-11-28 13:24:45.109798224 +0100
@@ -5341,6 +5341,19 @@ built with this option turned on will is
 tries to dereference a NULL pointer, or if a reference (possibly an
 rvalue reference) is bound to a NULL pointer.
+@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
+signed char a = SCHAR_MAX;
+@end smallexample
 @end table
 While @option{-ftrapv} causes traps for signed overflows to be emitted,


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]