The ISO C Standard requires CHAR_BIT
to be at least 8.
With POSIX mandating CHAR_BIT
be equal to 8, and (almost?) all networking and communication standards using octets, is there any contemporary C implementation where CHAR_BIT
> 8?
(Note: I'm not interested in historic computer architectures using 18 or 36 bit words. It's genuinely a question about C as it is used today on current hardware; think systems with a C99 or later implementation).
TMS320C28x DSP from Texas Instruments has a byte with 16 bits.
Documentation for the compiler specifies
CHAR_BIT
as 16 on page 101.This appears to be a modern processor (currently being sold), compilers supporting C99 and C++03.
Another example is Analog Devices' SHARC processor family. Its C implementation, CrossCore Embedded Studio, has
CHAR_BIT == 32
and claims to provide freestanding C99 and C++11 conformance.Analog Devices' SHARC DSP was already mentioned (CHAR_BIT==32). Let me add that recent SHARC+ cores (I use ADSP-SC589 and CCES toolchain) can run apps written in two modes: CHAR_BIT == 8 or CHAR_BIT == 32. You can even mix'n'match the two modes together in one app. Although I would not recommend this for development in general, I find it useful when porting code.