B
borophyll
As I read it, C99 states that a byte is an:
"addressable unit of data storage large enough to hold any member of
the basic character
set of the execution environment" (3.6)
and that a byte must be at least 8 bits:
"The values given below shall be replaced by constant expressions
suitable for use in #if
preprocessing directives. Moreover, except for CHAR_BIT and
MB_LEN_MAX, the
following shall be replaced by expressions that have the same type as
would an
expression that is an object of the corresponding type converted
according to the integer
promotions. Their implementation-defined values shall be equal or
greater in magnitude
(absolute value) to those shown, with the same sign."
number of bits for smallest object that is not a bit-field (byte)
CHAR_BIT 8 (5.2.4.2.1)
Does this mean that a byte can be larger than 8 bits (ie CHAR_BIT >
8)? I have gotten the impression that a byte, or unsigned char, was
always 8 bits, but perhaps I was wrong. If I am not, is there
somewhere in the standard that defines a byte as always being 8 bits?
Regards,
B.
"addressable unit of data storage large enough to hold any member of
the basic character
set of the execution environment" (3.6)
and that a byte must be at least 8 bits:
"The values given below shall be replaced by constant expressions
suitable for use in #if
preprocessing directives. Moreover, except for CHAR_BIT and
MB_LEN_MAX, the
following shall be replaced by expressions that have the same type as
would an
expression that is an object of the corresponding type converted
according to the integer
promotions. Their implementation-defined values shall be equal or
greater in magnitude
(absolute value) to those shown, with the same sign."
number of bits for smallest object that is not a bit-field (byte)
CHAR_BIT 8 (5.2.4.2.1)
Does this mean that a byte can be larger than 8 bits (ie CHAR_BIT >
8)? I have gotten the impression that a byte, or unsigned char, was
always 8 bits, but perhaps I was wrong. If I am not, is there
somewhere in the standard that defines a byte as always being 8 bits?
Regards,
B.