[EMAIL PROTECTED] (Ludovic Courtès) writes:
>
> 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.
Union elements start at the start of the combined space. In particular
if the elements are struct
Hi,
Kevin Ryde <[EMAIL PROTECTED]> writes:
> [EMAIL PROTECTED] (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 store
[EMAIL PROTECTED] (Ludovic Courtès) writes:
>
> `accept' would randomly yield a "bus error" on SPARC).
Looks ok.
> + if (((struct sockaddr *) &addr)->sa_family ...
That can use the union member instead of a cast, can it?
___
Guile-devel mailing list
Hi,
I just committed the attached patch, which fixes unaligned accesses in
`socket.c' (notably, `accept' would randomly yield a "bus error" on
SPARC). The trick is to use unions to allow the compiler to suitably
align variables.
Trying to compile with `-Wcast-align' (on SPARC) is instructive. T