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

Filip Pizlo fpizlo at apple.com
Thu Apr 10 22:56:16 PDT 2014


And #include <stdbool.h> doesn't work?

Most pre-C99 environments had that header. 

-Fil

> On Apr 10, 2014, at 10:37 PM, Kostya Serebryany <kcc at google.com> wrote:
> 
> [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
> 
> _______________________________________________
> 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/20140410/7421b3fc/attachment.html>


More information about the cfe-dev mailing list