From 0761b5253d57690e43cca9f4cc8155ecf223ee17 Mon Sep 17 00:00:00 2001 From: Matthias Braun Date: Tue, 16 Aug 2016 18:28:55 +0000 Subject: [PATCH] sanitizer_common: Fix warning Clang added warning that taking the address of a packed struct member possibly yields an unaligned pointer. This case is benign because the pointer gets casted to an uptr and not used for unaligned accesses. Add an intermediate cast to char* until this warning is improved (see also https://reviews.llvm.org/D20561) llvm-svn: 278835 --- .../lib/sanitizer_common/sanitizer_common_interceptors_ioctl.inc | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/compiler-rt/lib/sanitizer_common/sanitizer_common_interceptors_ioctl.inc b/compiler-rt/lib/sanitizer_common/sanitizer_common_interceptors_ioctl.inc index 959c622..4ed9afe 100644 --- a/compiler-rt/lib/sanitizer_common/sanitizer_common_interceptors_ioctl.inc +++ b/compiler-rt/lib/sanitizer_common/sanitizer_common_interceptors_ioctl.inc @@ -583,7 +583,8 @@ static void ioctl_common_pre(void *ctx, const ioctl_desc *desc, int d, return; if (request == IOCTL_SIOCGIFCONF) { struct __sanitizer_ifconf *ifc = (__sanitizer_ifconf *)arg; - COMMON_INTERCEPTOR_READ_RANGE(ctx, &ifc->ifc_len, sizeof(ifc->ifc_len)); + COMMON_INTERCEPTOR_READ_RANGE(ctx, (char*)&ifc->ifc_len, + sizeof(ifc->ifc_len)); } } -- 2.7.4