[cfe-dev] Clang header coexistence

David Chisnall csdavec at swansea.ac.uk
Sun Mar 29 08:13:56 PDT 2009


The current implementation of stdint.h in clang conflicts with the  
system headers on FreeBSD/i386.  Specifically, sys/types.h (and the  
system stdint.h) defines intptr_t as int (via two other typedefs) and  
clang's stdint.h defines it as long.  Both of these are 32-bit signed  
integers on IA32, but they are different according to the C type  
system and so throw an error preventing compilation of any file that  
includes both headers.

I believe the solution to this is to add this in the  
FreeBSDX86_32TargetInfo constructor, but I've not looked at this part  
of clang in any detail:

IntPtrType = SignedInt;

David



More information about the cfe-dev mailing list