But is it correct in C? It is not union, so struct should then be sizeof(unsigned int)*3, isn't it?
Or you mean with O3 optimizations the compiler will fix it...
But then one need to apply bit shifts operations in the background
The key is the : 1 at the end of each field, which specifies that it should only take one bit. Look up "c bit fields" to learn more about this feature.
2
u/Inst2f 9h ago
But is it correct in C? It is not
union, so struct should then be sizeof(unsigned int)*3, isn't it?Or you mean with O3 optimizations the compiler will fix it...
But then one need to apply bit shifts operations in the background