[PATCH] [ASan] Only include rpc headers if they are available.
Alexey Samsonov
vonosmas at gmail.com
Fri Apr 3 15:04:20 PDT 2015
REPOSITORY
rL LLVM
================
Comment at: lib/sanitizer_common/CMakeLists.txt:120
@@ +119,3 @@
+list(APPEND SANITIZER_COMMON_DEFINITIONS HAVE_RPC_XDR_H=${HAVE_RPC_XDR_H})
+check_include_file(tirpc/rpc/xdr.h HAVE_TIRPC_XDR_H)
+if (NOT HAVE_TIRPC_XDR_H)
----------------
Does HAVE_TIRPC_XDR_H get the value "1" in this macro? Consider moving this logic (check_include_file + adjusting the variable value) to some common macro.
================
Comment at: lib/sanitizer_common/sanitizer_platform.h:134
@@ +133,3 @@
+// Assume obsolete RPC headers are available by default
+#if SANITIZER_LINUX && !SANITIZER_ANDROID && \
+ !defined(HAVE_RPC_XDR_H) && !defined(HAVE_TIRPC_XDR_H)
----------------
I'd prefer the logic like this:
#if !defined(HAVE_RPC_XDR_H) && !defined(HAVE_TIRPC_XDR_H)
# define HAVE_RPC_XDR_H (SANITIZER_LINUX && !SANITIZER_ANDROID)
# define HAVE_TIRPC_XDR_H 0
#endif
================
Comment at: lib/sanitizer_common/sanitizer_platform_limits_posix.cc:1166
@@ -1161,2 +1165,3 @@
-#if SANITIZER_LINUX && !SANITIZER_ANDROID
+#if SANITIZER_LINUX && !SANITIZER_ANDROID && \
+ (HAVE_RPC_XDR_H || HAVE_TIRPC_XDR_H)
----------------
Looks like you can use just use
#if (HAVE_RPC_XDR_H || HAVE_TIRPC_XDR_H)
here
http://reviews.llvm.org/D8698
EMAIL PREFERENCES
http://reviews.llvm.org/settings/panel/emailpreferences/
More information about the llvm-commits
mailing list