[PATCH] D40900: [Sanitizers, test] Fix sanitizer tests on Solaris (PR 33274)
Rainer Orth via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Thu Dec 7 01:44:26 PST 2017
ro added inline comments.
================
Comment at: test/asan/TestCases/Posix/ioctl.cc:13
+#if defined(__sun__) && defined(__svr4__)
+#include <sys/filio.h>
----------------
krytarowski wrote:
> Do we need to check for `__svr4__`? Are there other alive SunOS systems?
It's still the customary way to check for Solaris and derivatives,
though you'll be hard pressed to find a SunOS 4 system around.
================
Comment at: test/asan/TestCases/alloca_loop_unpoisoning.cc:17
+#elif defined(__FreeBSD__) || defined(__NetBSD__)
+#include <stdlib.h>
+#else
----------------
krytarowski wrote:
> <stdlib.h> is included above.
Missed that, thanks. We can either change the section to
#elif defined(__FreeBSD__) || defined(__NetBSD__)
-#include <stdlib.h>
+// alloca is declared in <stdlib.h>.
#else
#include <alloca.h>
since the BSDs lack <alloca.h> or add a specific guard
for alloca.h inclusion.
My general point about moving such code to a common
test header to avoid duplication in several places still stands.
================
Comment at: test/asan/TestCases/debug_double_free.cc:20
+#elif defined(__sun__) && defined(__svr4__)
+# define PTR_FMT "0x%p"
#else
----------------
krytarowski wrote:
> Is there an option to use `%#p`?
No: although printf(3C) accepts it, it only adds 0x/0X for the
%x and %X formats, not %p.
Repository:
rCRT Compiler Runtime
https://reviews.llvm.org/D40900
More information about the llvm-commits
mailing list