Re: [PATCH][2.6] IBM PowerPC Virtual Ethernet Driver
From: Benjamin Herrenschmidt
Date: Wed Feb 18 2004 - 00:10:26 EST
> There's a difference between "the standard doesn't guarantee anything" and
> "the implementation makes no sense".
>
> (Sadly, a lot of compiler people do seem to look to standards more than
> actual users for guides to do things, but at the same time I do believe
> that gcc has useful semantics for bitfields and hardware accesses. You
> just have to know what the implementation-specific rules are)
Well... I still think it's asking for trouble in the long term
to rely on them .... It's definitely broken for drivers of devices
that can be used on different archs (PCI cards for example) since
the layout of the bitfields is different at least with gcc between
big and little endian machines. But I've also been bitten by
alignement issues within the bitfield in the past (not with gcc
though) and other funny things like that...
So overall, I just recommend to get rid of them.
Ben.
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/