lkml.org 
[lkml]   [2014]   [Nov]   [26]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
SubjectRe: [RFC v2 1/2] compiler: use compiler to detect integer overflows
From
On Wed, Nov 26, 2014 at 3:58 PM, Sasha Levin <sasha.levin@oracle.com> wrote:
> We've used to detect integer overflows by causing an overflow and testing the
> result. For example, to test for addition overflow we would:

So I don't like this, for a very simple reason: it doesn't work for
older gcc versions.

Your "check_add_overflow()" doesn't actually do it. It just
perpetuates any bugs you find. For unsigned additions, it's pointless,
and for signed additions it remains as buggy as it was before.

Also, your commit message is still *very*wrong*. You can't claim that
integer addition overflow is undefined. It's undefined onyl for
_signed_ integer types, and that's a big big difference.

So no. This still doesn't work.

Linus


\
 
 \ /
  Last update: 2014-11-27 02:01    [W:0.067 / U:0.700 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site