This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [C++ PATCH] -Wsizeof-pointer-memaccess warning (take 2)


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]