[PATCH] A fix for platform-dependent types in sanitizers' profiling support lib on x64 FreeBSD in 32-bit mode

Viktor Kutuzov vkutuzov at accesssoftek.com
Mon Feb 24 08:42:12 PST 2014



================
Comment at: lib/profile/GCDAProfiling.c:38
@@ +37,3 @@
+// System headers define 'size_t' incorrectly on x64 FreeBSD (prior to
+// FreeBSD 10, r232261) when compiled in 32-bit mode.
+typedef unsigned char uint8_t;
----------------
Joerg Sonnenberger wrote:
> __LP64__ also matches SPARC64. I think this should include sys/param.h in the FreeBSD branch and use a proper version check. Alternatively, use the __INT64_TYPE__ predefine.
> __LP64__ also matches SPARC64.

Right, will replace with ##__x86_64__## . Thanks.

> I think this should include sys/param.h in the FreeBSD branch and use a proper version check.

Unfortunately, ##<sys/param.h>## includes ##<sys/types.h>## which defines the fixed-width types.

> Alternatively, use the __INT64_TYPE__ predefine.

I believe there's no way to test the value of the macro in ###if##?

================
Comment at: lib/profile/GCDAProfiling.c:42
@@ +41,3 @@
+typedef unsigned long long uint64_t;
+int mkdir(const char*, unsigned short);
+#else
----------------
Joerg Sonnenberger wrote:
> Include unistd.h?
##<unistd.h>## too includes ##<sys/types.h>##.


http://llvm-reviews.chandlerc.com/D2866



More information about the llvm-commits mailing list