This is the mail archive of the gcc-patches@gcc.gnu.org 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]

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


Ping.  The implementation has been commited.

On Thu, Nov 28, 2013 at 01:32:24PM +0100, Marek Polacek wrote:
> As promised, this patch on top of this patch by Tobias:
> http://gcc.gnu.org/ml/gcc-patches/2013-11/msg03082.html
> adds the documentation for -fsanitize=signed-integer-overflow.
> 
> Ok to install after the actual implementation is in?
> 
> 2013-11-28  Marek Polacek  <polacek@redhat.com>
> 
> 	* 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
> +overflow:
> +@smallexample
> +signed char a = SCHAR_MAX;
> +a++;
> +@end smallexample
> +
>  @end table
>  
>  While @option{-ftrapv} causes traps for signed overflows to be emitted,

	Marek


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