RE: [Bluez-devel] Alignment issue

David Woodhouse
2004-08-12T08:34:49Z

On Wed, 2004-08-11 at 21:31 +0200, Marcel Holtmann wrote:
> this is what the Linux kernel is using and we will notice it if some
> compiler version will optimize it in future. I committed that change to
> CVS.

The Linux kernel isn't the best example to follow when it comes to
relying on undocumented and unguaranteed compiler behaviour. Don't be so
sure the kernel would notice -- we have to fix up alignment trap in the
kernel _anyway_ so the use of get_unaligned() is only an optimisation
there.

I'd be more inclined to play with using char * pointers in the memcpy,
and/or __attribute__((packed)).

--
dwmw2