[cfe-dev] Way to disable sanitize checks locally

Sean McBride sean at rogue-research.com
Thu Dec 13 10:27:20 PST 2012


On Thu, 13 Dec 2012 10:06:49 -0800, zapadinsky said:

>Hi I am new here. I am using clang to check errors in our code. Specifically
>integer overflows. But sometimes it is ok, some dirty code are ok, for
>example in hash function calculation. How can I disable sanitize checks
>locally for one inlined function for example?

Are your hash function calculations using unsigned integers or signed integers?  Overflowing the former is well-defined, the latter is not.  That's why -fsanitize=undefined does not include -fsanitize=unsigned-integer-overflow, see here:

<http://clang.llvm.org/docs/UsersManual.html#controlling-code-generation>

Cheers,

-- 
____________________________________________________________
Sean McBride, B. Eng                 sean at rogue-research.com
Rogue Research                        www.rogue-research.com 
Mac Software Developer              Montréal, Québec, Canada






More information about the cfe-dev mailing list