On 06-08-30 15:06 Michael Buesch wrote:

> Because this clearly is a workaround for broken compilers to me,
> I would rather do the following:
> 
> +} /* __attribute__((packed)) */;
> 
> 
> This way it's still clear to the reader, that these structs
> must be packed and are most likely for communication with
> the hardware.

I'm not so sure, whether the compilers are broken. On platforms
like SPARC and IA-64 that don't support unaligned memory access
the compiler has to create slow code for each packed field access.
If the compiler would create fast code for accessing packed fields
that are actually aligned inside the struct, it would break code
that access the struct at unaligned locations. You could say these
guys are relying on undefined behaviour but I would like to see
how the SPARC folks would react, when gcc would break old code.

Ciao,

Uli

-- 
Uli Kunitz
-
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to