Commit e493d6ac by hellowangsai Committed by GitHub

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.
parent e63a5a61
...@@ -45,17 +45,7 @@ ...@@ -45,17 +45,7 @@
// For all three tools, replacing an unaligned access with a tool-specific // For all three tools, replacing an unaligned access with a tool-specific
// callback solves the problem. // callback solves the problem.
// Make sure uint16_t/uint32_t/uint64_t are defined. #include <sanitizer/common_interface_defs.h>
#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"
namespace absl { namespace absl {
ABSL_NAMESPACE_BEGIN ABSL_NAMESPACE_BEGIN
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment