0

How does gcc order bitfields on a little-endian machine? Is the first entry the most significant bit or what?

3
Contributors
5
Replies
7
Views
9 Years
Discussion Span
Last Post by jephthah
0

>Is the first entry the most significant bit or what?
IIRC, it's or what.

>bump
Don't bump your threads, it's rude. I mean really, is 30 minutes really that long to wait? It's not like Daniweb is a real-time chat with paid people helping 24/7 or anything.

0

>As for the question?
Sorry, I guess my joke was too subtle. The answer is "or what". IIRC, when you have the following in gcc, a is the least significant bit:

struct foo {
  unsigned int a:1;
  unsigned int b:1;
};
0

How does gcc order bitfields on a little-endian machine? Is the first entry the most significant bit or what?

endianness referrs to byte ordering, not bits. bit ordering is always the same. endianness describes the direction that bytes are stored in increasing memory locations. big-endian means "big end first". little-endian means "little end first"

but really, it all comes down to the fact that the Blefuscudians are stupid fools who ruin perfectly good soft-boiled eggs.

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.