[cfe-dev] Question about use of bool in asan_interface.h

Kostya Serebryany kcc at google.com
Thu Apr 10 22:37:55 PDT 2014


[sorry for late response]
Yea... I think we should simply change bool to int in the headers.
Let me see if this is going to break something...
Meanwhile, i'd expect that your hack is going to work fine.

--kcc


On Tue, Apr 8, 2014 at 5:20 PM, Oliver Schneider <oliver at f-prot.com> wrote:

> Hi,
>
> I am trying to make use of the ASAN callbacks from C. However,
> asan_interface.h uses bool in the public interface. This type has "only"
> been introduced in C99. Unfortunately for me this means I have it not
> available.
>
> Is it sufficient to do something like:
>
> #   if !defined(__STDC_VERSION__) || (__STDC_VERSION__ < 199901L)
>     typedef unsigned char bool;
> #   endif
> #   include<sanitizer/asan_interface.h>
>
> or would this break anything? If it breaks something, what alternatives
> do I have if I cannot use C99 mode?
>
> Thanks,
>
> // Oliver
>
>
> _______________________________________________
> cfe-dev mailing list
> cfe-dev at cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/cfe-dev
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-dev/attachments/20140411/189ac8b0/attachment.html>


More information about the cfe-dev mailing list