This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [PATCH] Fix PR44555
On Wed, Jun 16, 2010 at 2:03 PM, Dave Korn <dave.korn.cygwin@gmail.com> wrote:
> On 16/06/2010 21:47, Dave Korn wrote:
>
>> address from the loaded data item! ÂThis happens because the '&' operator is
>> really a compile-time operation like sizeof, whereas a dereference is a
>> runtime one;
>
> ÂThat made me wonder, what does the standard say about "sizeof (*(TYPE
> *)NULL)"? ÂIt looks to me like it's probably also undefined. ÂOn the other
> hand, I found a footnote (#87 in n1256, on section 6.5.3.2 para 4) that says
Except the expression inside sizeof is not evaluated at all so it is
not invoking undefined behavior.
(I have not looked up the paragraph number though).
Thanks,
Andrew Pinski