[PATCH] Fix PR44555
Andreas Schwab
schwab@redhat.com
Thu Jun 17 08:49:00 GMT 2010
Dave Korn <dave.korn.cygwin@gmail.com> writes:
> 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
>
>> &*E is equivalent to E (even if E is a null pointer)
>
> so I figure that's more or less precedent for allowing &(A->B) even if A is a
> null pointer.
&a->b is &((*a).b), so it doesn't match &*E. The result of -> is only
defined for a pointer to an object, whereas the standard is explicit
about &*E that the indirection and address operators are not evaluated.
Andreas.
--
Andreas Schwab, schwab@redhat.com
GPG Key fingerprint = D4E8 DBE3 3813 BB5D FA84 5EC7 45C6 250E 6F00 984E
"And now for something completely different."
More information about the Gcc-patches
mailing list