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: Aliasing bug


Andrew Stubbs wrote:
> On 02/07/09 14:34, Richard Guenther wrote:
>> No, that's invalid.  You would have to do
>>
>> extern union {
>>    void *foo;
>>    short *bar;
>> };
>>
>> using the union for the double-indirect pointer doesn't help.  Or
>> simply use memcpy to store to foo.
> 
> Ah, I did not know that. I still don't understand how a reference to a
> memory location that happens to contain a pointer is different to one
> what contains other data?

It's easy enough to find out: just look at the C standard.  6.3.2.3, Pointers.

Andrew.


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