This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [RFC PATCH] -Wsizeof-pointer-memaccess warning
- From: "Joseph S. Myers" <joseph at codesourcery dot com>
- To: Jakub Jelinek <jakub at redhat dot com>
- Cc: <gcc-patches at gcc dot gnu dot org>, Jason Merrill <jason at redhat dot com>, Paolo Carlini <paolo dot carlini at oracle dot com>
- Date: Wed, 15 Aug 2012 15:39:29 +0000
- Subject: Re: [RFC PATCH] -Wsizeof-pointer-memaccess warning
- References: <20120718124014.GH9077@tucnak.redhat.com>
On Wed, 18 Jul 2012, Jakub Jelinek wrote:
> + if (warn_sizeof_pointer_memaccess
> + && sizeof_arg != NULL_TREE)
> + sizeof_pointer_memaccess_warning (c_last_sizeof_arg_loc,
> + expr.value, exprlist,
> + sizeof_arg,
> + sizeof_ptr_memacc_comptypes);
Why do you pass a local variable sizeof_arg but a global
c_last_sizeof_arg_loc here? I'd have expected the same approach to apply
for both arguments (e.g. passing down a pointer to a location alongside
&sizeof_arg).
--
Joseph S. Myers
joseph@codesourcery.com