Well, this was a waste of time. He makes some subtle mistakes, but nothing even worth pointing out. elliott cable this guy isn't. >>1-chan, don't make any more threads if this is what you're going to post.
The C standard says a bunch of stuff leads to undefined behavior. Real compilers take advantage of that to optimize away code, sometimes with surprising results.
I love it when my compiler silently does the wrong thing! This is why C and C++ are the best programming languages.
Consider this bit packing struct:
struct eeh_type
{
uint16 size: 10; /* 10 bits */
uint16 code: 6; /* 6 bits */
};
Depending on which C compiler, and which "endian" flavor of machine you are on, this might actually be implemented as
<10-bits><6-bits>
or as
<6-bits><10-bits>
Also, again depending on the C compiler, machine architecture, and various mysterious preference settings, the items might be aligned to the nearest 8, 16, 32, or 64 bits.
So what matters? If you are trying to match bits with a real world file, everything!