Bit fields do suffer from a lack of portability between platforms. Why?
Bit fields are a convenient way to express many difficult operations. However, bit fields do suffer from a lack of portability between platforms:
- Integers may be signed or unsigned
- Many compilers limit the maximum number of bits in the bit field to the size of an integer which may be either 16-bit or 32-bit varieties.
- Some bit field members are stored left to right others are stored right to left in memory.
- If bit fields too large, next bit field may be stored consecutively in memory (overlapping the boundary between memory locations) or in the next word of memory.
Bit fields do suffer from a lack of portability between platforms. Why?
Reviewed by MCH
on
July 17, 2012
Rating:
No comments: