3 ms·
Experience indicates otherwise. If you must use bit fields, make them unsigned. Bugs love to hide under signed bit fields.
by ncmncm 5y ago
Experience indicates otherwise.
If you must use bit fields, make them unsigned. Bugs love to hide under signed bit fields.
- jstimpfle 5y agoThat makes sense, looking at how signed arithmetic works on different architectures it would feel strange to use signed bitfields. Unsigned bitfields are a nice way to get modular arithmetic with n bits without syntactic clutter.
- ncmncm 5y ago"Unsigned bitfields are a nice ..." Appear to be. Are, when all the stars align. Are not in fact, often enough that you are issued a red warning you may ignore if you are insulated from all consequences.