|
|
|
|
|
by nrdvana
1567 days ago
|
|
I also find that questionable. The compiler is allowed to pull a bit field from low or high bits (i.e. not specified in the standard) and it might be further affected by endianness. This code is assuming that on little-endian, gcc pulls 62 bits from the low bits of the word, and on big-endian that gcc pulls from the high 62 bits of the word. It might actually be what gcc does, but I don't think any of that is guaranteed. |
|
That's concerning.. Should I rather use a full 64bit data field + masking ? I'm a bit naive about portability.