summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGravatar hellowangsai <hellowangsai@qq.com>2020-10-13 01:35:08 +0800
committerGravatar GitHub <noreply@github.com>2020-10-12 13:35:08 -0400
commite493d6acb426542ec90db9baf749d0c521ed3302 (patch)
treeefe22c64b4ef7b62017371ed11e26ddef7df5160
parente63a5a61045e516b7b3dbca090e2b9ff1d057e46 (diff)
fix compile fails with asan and -Wredundant-decls (#801)
If compile with asan, unaligned_access.h redeclares the same sanitizer function with sanitizer/common_interface_defs.h. This patch removes these declarations and includes sanitizer header file to avoid this warning.
-rw-r--r--absl/base/internal/unaligned_access.h12
1 files changed, 1 insertions, 11 deletions
diff --git a/absl/base/internal/unaligned_access.h b/absl/base/internal/unaligned_access.h
index dd5250de..080c197c 100644
--- a/absl/base/internal/unaligned_access.h
+++ b/absl/base/internal/unaligned_access.h
@@ -45,17 +45,7 @@
// For all three tools, replacing an unaligned access with a tool-specific
// callback solves the problem.
-// Make sure uint16_t/uint32_t/uint64_t are defined.
-#include <stdint.h>
-
-extern "C" {
-uint16_t __sanitizer_unaligned_load16(const void *p);
-uint32_t __sanitizer_unaligned_load32(const void *p);
-uint64_t __sanitizer_unaligned_load64(const void *p);
-void __sanitizer_unaligned_store16(void *p, uint16_t v);
-void __sanitizer_unaligned_store32(void *p, uint32_t v);
-void __sanitizer_unaligned_store64(void *p, uint64_t v);
-} // extern "C"
+#include <sanitizer/common_interface_defs.h>
namespace absl {
ABSL_NAMESPACE_BEGIN