[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Unaligned memory accesses
From: |
Ludovic Courtès |
Subject: |
Re: Unaligned memory accesses |
Date: |
Tue, 04 Sep 2007 09:40:13 +0200 |
User-agent: |
Gnus/5.11 (Gnus v5.11) Emacs/22.1 (gnu/linux) |
Hi,
Kevin Ryde <address@hidden> writes:
> address@hidden (Ludovic Courtès) writes:
>> + if (((struct sockaddr *) &addr)->sa_family ...
>
> That can use the union member instead of a cast, can it?
No it can't. AFAICS, there's nothing in the C standard forcing fields
of unions to be stored at offset zero when said fields have different
sizes.
Thanks,
Ludovic.