On 12/4/06, Kristian Høgsberg <krh@xxxxxxxxxx> wrote:Ok... I was planning to make big-endian versions of the structs so that the
endian issue would be solved. But if the bit layout is not consistent, I
guess bitfields are useless for wire formats. I didn't know that though, I
thought the C standard specified that the compiler should allocate bits out of
a word using the lower bits first.
The C standard explicitly allows it to be implementation defined.
Having been bit by this exact problem, I can also recommend never
using bitfields for anything other than things kept solely in local
memory.