|
|
|
|
|
by cryptonector
323 days ago
|
|
Bitfields have other problems. Say you have two bitfields each of `uint8_t` type and totaling 16 bits: well, you might think that's _two_ fields, but the compiler is allowed to treat them as _one_ whenever it wants to, and _that_ can be a problem if you're accessing one with atomics and the other without because the other can yield unsynchronized accesses to the one that needs synchronization. Bitfields in C leave way too much behavior to the compiler or undefined. It's really intolerable. |
|
Even crazier is the fact that an int bitfield's signedness is implementation defined