This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [C++ PATCH] -Wsizeof-pointer-memaccess warning (take 2)
- From: Dodji Seketeli <dodji at seketeli dot org>
- To: Jakub Jelinek <jakub at redhat dot com>
- Cc: Jason Merrill <jason at redhat dot com>, gcc-patches at gcc dot gnu dot org
- Date: Wed, 03 Oct 2012 11:14:37 +0200
- Subject: Re: [C++ PATCH] -Wsizeof-pointer-memaccess warning (take 2)
- References: <20120816191535.GM1999@tucnak.redhat.com> <5059CF5F.4030308@redhat.com> <20120925153640.GM1787@tucnak.redhat.com> <20121002125629.GJ1787@tucnak.redhat.com>
Jakub Jelinek <jakub@redhat.com> a Ãcrit:
> --- gcc/cp/call.c.jj 2012-09-27 12:45:49.000000000 +0200
> +++ gcc/cp/call.c 2012-10-01 17:53:17.594609236 +0200
> @@ -557,7 +557,10 @@ null_ptr_cst_p (tree t)
> {
> /* Core issue 903 says only literal 0 is a null pointer constant. */
> if (cxx_dialect < cxx0x)
> - t = integral_constant_value (t);
> + {
> + t = integral_constant_value (t);
> + t = maybe_constant_value (t);
> + }
Just for my education, why couldn't maybe_constant_value just call
integral_constant_value, so that we just use maybe_constant_value here?
Even after reading the comments of these two functions, /having/ to use
them like this seems confusing to the casual reader in me.
--
Dodji