On Sat, Nov 24, 2007 at 06:35:25PM +0100, Pierre Ossman wrote: > On Sat, 24 Nov 2007 17:22:36 +0000 > Luciano Rocha <[email protected]> wrote: > > > On Sat, Nov 24, 2007 at 05:19:31PM +0100, Pierre Ossman wrote: > > > It most certainly does not. gcc will assume that an int* has int alignment. memcpy() is a builtin, which gcc can translate to pretty much anything. And C specifies that a pointer to foo, will point to a real object of type foo, so gcc can't be blamed for the unsafe typecasts. I have tested this the hard way, so this is not just speculation. > > > > Yes, on *int and other assumed aligned pointers, gcc uses its internal > > version. > > > > However, my point is that those pointers, unless speaking of packed > > structures, can safely be assumed aligned, while char*/void* can't. > > > > I get the sensation we're violently in agreement here, just misunderstanding each other. :) That's it. :) Sorry for the noise,... -- lfr 0/0
Attachment:
pgpYe8L6xlloZ.pgp
Description: PGP signature
- References:
- [RFC] Documentation about unaligned memory access
- From: Daniel Drake <[email protected]>
- Re: [RFC] Documentation about unaligned memory access
- From: Pierre Ossman <[email protected]>
- Re: [RFC] Documentation about unaligned memory access
- From: Luciano Rocha <[email protected]>
- Re: [RFC] Documentation about unaligned memory access
- From: Pierre Ossman <[email protected]>
- Re: [RFC] Documentation about unaligned memory access
- From: Luciano Rocha <[email protected]>
- Re: [RFC] Documentation about unaligned memory access
- From: Pierre Ossman <[email protected]>
- [RFC] Documentation about unaligned memory access
- Prev by Date: Re: 2.6.24-rc3-mm1: I/O error, system hangs
- Next by Date: Re: [BUG] jiffies counter leaps in 2.6.24-rc3
- Previous by thread: Re: [RFC] Documentation about unaligned memory access
- Next by thread: Re: [RFC] Documentation about unaligned memory access
- Index(es):