From e34f6466ce9ddbc5c9c327cbcd8902f740748495 Mon Sep 17 00:00:00 2001 From: David Malcolm Date: Mon, 6 Nov 2017 16:53:01 -0500 Subject: [PATCH 06/14] Fix Wsizeof-pointer-memaccess*.c gcc/c-family/ChangeLog: * c-warn.c (sizeof_pointer_memaccess_warning): Strip any location wrappers from src and dest. --- gcc/c-family/c-warn.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/gcc/c-family/c-warn.c b/gcc/c-family/c-warn.c index 09ef685..245c37d 100644 --- a/gcc/c-family/c-warn.c +++ b/gcc/c-family/c-warn.c @@ -770,6 +770,11 @@ sizeof_pointer_memaccess_warning (location_t *sizeof_arg_loc, tree callee, if (idx >= 3) return; + if (src) + STRIP_ANY_LOCATION_WRAPPER (src); + if (dest) + STRIP_ANY_LOCATION_WRAPPER (dest); + if (sizeof_arg[idx] == NULL || sizeof_arg[idx] == error_mark_node) return; -- 1.8.5.3