[cfe-dev] [analyzer] Introducing FloatingCompare checker

Kirill Bobyrev via cfe-dev cfe-dev at lists.llvm.org
Thu Sep 3 01:05:53 PDT 2015

Uh, my bad!

I was checking whether such functionality was already implemented by 
running analysis on the sample piece of code provided by the checker 
description in the list, I didn't see any warning, so I assumed it's not 

Thank you very much for the feedback! I'll pick another item from the 
list :)


Kirill Bobyrev

On 9/3/2015 8:39 AM, Anna Zaks wrote:
> Hi Kirill,
> The checkPreStmt callback should be used by checkers that require 
> symbolic execution. Check out the video of our talk for introduction 
> into how that works 
> http://llvm.org/devmtg/2012-11/videos/Zaks-Rose-Checker24Hours.mp4. 
> Looks like this checker is only performing a syntactic check, so using 
> an AST visitor would be more appropriate 
> http://clang-analyzer.llvm.org/checker_dev_manual.html#ast.
> However, most importantly, similar functionality is already 
> implemented in the compiler (see -Wfloat-equal)! Looks like it does 
> not work when comparing against a constant. I am not sure what the 
> reason for that is; was it a a source of false positives or just an 
> oversight.
> Since the warning is in place, we should remove this from the list of 
> checkers to be implemented.
> Thank you,
> Anna.
>> On Sep 2, 2015, at 2:58 PM, Kirill Bobyrev via cfe-dev 
>> <cfe-dev at lists.llvm.org <mailto:cfe-dev at lists.llvm.org>> wrote:
>> I've started implementing different.FloatingCompare checker from the 
>> list of potential checkers 
>> <http://clang-analyzer.llvm.org/potential_checkers.html>. I'd like to 
>> gather some feedback and do some improvements in order to push the 
>> code to the upstream in the near future.
>> Vassil Vassilev mentioned it might be reasonable if the checker could 
>> detect that there is division which might yield precision loss and 
>> then detect a check against a 'constant' values.
>> What do you think? What should be the checker's default behavior?
>> The first version of checker is attached.
>> --
>> Kirill Bobyrev
>> https://github.com/omtcyf0
>> <FloatingCompareChecker.patch>_______________________________________________
>> cfe-dev mailing list
>> cfe-dev at lists.llvm.org <mailto:cfe-dev at lists.llvm.org>
>> http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-dev

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-dev/attachments/20150903/c2ba429a/attachment.html>

More information about the cfe-dev mailing list