lkml.org 
[lkml]   [2014]   [Nov]   [26]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
SubjectRe: [RFC 1/2] compiler: use compiler to detect integer overflows
From
On Wed, Nov 26, 2014 at 10:50 AM, Sasha Levin <sasha.levin@oracle.com> wrote:
>
> The kernel still has it's share of *signed* integer overflows. Example? fadvise64_64():

Yes, those would definitely be worth fixing.

[ Although quite frankly, since I know gcc already knows about the
whole "check for overflow" pattern, from a QoI standpoint it is sad
that it then might optimize it away. Kind of like how it would trust
the type-based strict alias analysis more than the obvious *static*
alias analysis. Oh well ]

I don't think coccinelle can do signedness checks, though, especially
of the kind that are hidden deep behind some typedef like "loff_t".
Maybe I'm wrong. Maybe smatch can? Adding Dan Carpenter to the cc..

Linus


\
 
 \ /
  Last update: 2014-11-26 20:21    [W:0.058 / U:0.152 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site