diff mbox series

[06/14] Fix Wsizeof-pointer-memaccess*.c

Message ID 1510350329-48956-7-git-send-email-dmalcolm@redhat.com
State New
Headers show
Series Preserving locations for variable-uses and constants (PR 43486) | expand

Commit Message

David Malcolm Nov. 10, 2017, 9:45 p.m. UTC
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(+)

Comments

Jason Merrill Dec. 11, 2017, 11:37 p.m. UTC | #1
On 11/10/2017 04:45 PM, David Malcolm wrote:
> gcc/c-family/ChangeLog:
> 	* c-warn.c (sizeof_pointer_memaccess_warning): Strip any location
> 	wrappers from src and dest.

Here the existing calls to tree_strip_nop_conversions ought to handle 
the wrappers.

Jason
diff mbox series

Patch

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;