Philipp Klaus Krause
2022-01-04 12:15:54 UTC
C23 Bit-precise integer types
(http://www.open-std.org/jtc1/sc22/wg14/www/docs/n2763.pdf) allow
programmers to explicitly state their intent on how many bits are
needed; but since they are addressable, they need padding bits when
their width is not a multiple of CHAR_WIDTH. Some implementations might
use more padding for alignment. Where there is a need to save memory,
they are thus not suitable. Using bit-precise integer types in
bit-fields solves this issue.
So, I'd like to see bit-fields of bit-precise integer types in C:
http://www.colecovision.eu/stuff/proposal-bit-precise-bit-fields.html
(http://www.open-std.org/jtc1/sc22/wg14/www/docs/n2763.pdf) allow
programmers to explicitly state their intent on how many bits are
needed; but since they are addressable, they need padding bits when
their width is not a multiple of CHAR_WIDTH. Some implementations might
use more padding for alignment. Where there is a need to save memory,
they are thus not suitable. Using bit-precise integer types in
bit-fields solves this issue.
So, I'd like to see bit-fields of bit-precise integer types in C:
http://www.colecovision.eu/stuff/proposal-bit-precise-bit-fields.html