I thought that endianness is not supposed to affect structs of size at most 1 byte. But here\'s the code on my little endian machine:
#include
#
So let me gather all the info from comments.
It seems that the order of bit fields is not specified in the standard and thus is implementation dependent. The relevant part of the standard is (thanks to @molbdnilo):
§9.6: "Bit-fields are assigned right-to-left on some machines, left-to-right on others."
Also let me note other comments. It seems that the order of bit fields is simply reversed in memory. This seems to be consistent with the order of normal fields as well and is probably consistent with endianness (I would appreciate if someone can check it on a big-endian machine).
I guess that's what "right-to-left on some machines" and "left-to-right on others" means. However this is my interpretation and as stated earlier we should not depend on it.