Liste des Groupes | Revenir à cl c |
bart <bc@freeuk.com> writes:There's no 'byte' type. There's an odd selection of *5* char, short, int, long and long long types which cover the *4* 8/16/32/64 bit sizes.On 06/07/2024 02:38, Lawrence D'Oliveiro wrote:What???On Fri, 5 Jul 2024 14:31:44 +0100, bart wrote:>
>C also is the only language that is supposed to work on any kind ofI don’t think there is anything innate in the design of C to ensure
processor ...
that.
It was simply its popularity that meant it was usually the first language
implemented on a new processor.
For example, C assumes byte addressability.
C didn't define a 'byte' at all. It assumed 'char' addressability, but
allowed that 'char' to be any width at all. I think at some point a
minimum of 8 bits was applied.
C defines a "byte" as an "addressable unit of data storage large enough
to hold any member of the basic character set of the execution
environment". You know that. C references going back to 1974 all talk
about bytes (the early ones are specific to the PDP-11).
Perhaps you meant that there's no predefined type named "byte", but
nobody said there was.
The requirement that a byte is at least 8 bits goes back at least to
C89. K&R1 (1978) doesn't make this requirement explicit, but shows
examples of 8- and 9-bit bytes.
[...]
Most of today's hardware evolved from such a model: 32- and 64-bitRight, C makes it *so* difficult to support systems with 8-bit bytes and
words and addresses were an obvious natural progression. C however
still hasn't got the memo.
32- or 64-bit word.
Les messages affichés proviennent d'usenet.