[cfe-dev] Way to disable sanitize checks locally

Will Dietz willdtz at gmail.com
Thu Dec 13 11:55:13 PST 2012


On Thu, Dec 13, 2012 at 12:27 PM, Sean McBride <sean at rogue-research.com> wrote:
> 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?
>

Glad to hear it!

Adding attributes to annotate safe locations is on my TODO list, as
this is an important feature for usability.  It shouldn't take too
long, but even so unfortunately I don't think I'll be able to get to
it for at least a few days.

Apologies for any inconvenience!

~Will

> 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
>
>
>
> _______________________________________________
> cfe-dev mailing list
> cfe-dev at cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/cfe-dev




More information about the cfe-dev mailing list