[PATCH] D13126: New static analyzer checker for loss of sign/precision

Devin Coughlin via cfe-commits cfe-commits at lists.llvm.org
Fri Dec 4 10:32:25 PST 2015


dcoughlin added a subscriber: dcoughlin.
dcoughlin added a comment.

In http://reviews.llvm.org/D13126#302328, @danielmarjamaki wrote:

> When scanning 692 projects with this checker I got 56 warnings. I've triaged 21 random warnings of these so far and saw 20 TP and 1 FP.
>
> When I have triaged the results there is one kind of "possible FP" that I see, like this:
>
>   unsigned long x = largevalue;
>   bytes[0] = x;  // Possible FP here. Technically it's a TP but it's an loss of precision by design.
>   bytes[1] = x >> 8;
>   ....
>   
>
> I am currently considering to allow this FP. Any opinions about allowing it?


Is there mechanism by which the user can suppress false positives like this (for example, an explicit cast)?


http://reviews.llvm.org/D13126





More information about the cfe-commits mailing list