This is the mail archive of the gcc@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: GCC aliasing rules: more aggressive than C99?


On 01/05/2010 01:15 AM, Erik Trulsson wrote:
> On Mon, Jan 04, 2010 at 08:17:00PM +0000, Joshua Haberman wrote:
>> Andrew Haley <aph <at> redhat.com> writes:
>>> On 01/03/2010 10:14 PM, Joshua Haberman wrote:
>>>> Andrew Haley <aph <at> redhat.com> writes:
>>> "6.3.2.3
>>>
>>> "A pointer to an object or incomplete type may be converted to a
>>> pointer to a different object or incomplete type. If the resulting
>>> pointer is not correctly aligned for the pointed-to type, the
>>> behavior is undefined. Otherwise, when converted back again, the
>>> result shall compare equal to the original pointer."
>>>
>>> This is *all* you are allowed to do with the converted pointer.  You
>>> may not dereference it.
>>
>> The text you quoted does not contain any "shall not" language about
>> dereferencing, so this conclusion does not follow.
> 
> It doesn't have to use any "shall not" language.  If the standard does not
> say that any particular action is allowed or otherwise defines what it
> does, then that action implicitly has undefined behaviour.

Exactly.  I think the OP is just being stubborn now.

Andrew.


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