Sujet : Re: technology discussion → does the world need a "new" C ?
De : Keith.S.Thompson+u (at) *nospam* gmail.com (Keith Thompson)
Groupes : comp.lang.cDate : 07. Jul 2024, 00:04:53
Autres entêtes
Organisation : None to speak of
Message-ID : <874j92unoq.fsf@nosuchdomain.example.com>
References : 1 2 3 4 5 6
User-Agent : Gnus/5.13 (Gnus v5.13)
bart <
bc@freeuk.com> writes:
On 06/07/2024 02:38, Lawrence D'Oliveiro wrote:
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 of
processor ...
I don’t think there is anything innate in the design of C to ensure
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.
What???
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-bit
words and addresses were an obvious natural progression. C however
still hasn't got the memo.
Right, C makes it *so* difficult to support systems with 8-bit bytes and
32- or 64-bit word.
-- Keith Thompson (The_Other_Keith) Keith.S.Thompson+u@gmail.comvoid Void(void) { Void(); } /* The recursive call of the void */