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 : 06. Jul 2024, 03:00:58
Autres entêtes
Organisation : None to speak of
Message-ID : <87plrruvmt.fsf@nosuchdomain.example.com>
References : 1 2 3 4 5
User-Agent : Gnus/5.13 (Gnus v5.13)
Lawrence D'Oliveiro <
ldo@nz.invalid> writes:
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. So that causes awkwardness on
architectures like the PDP-10, for example. It just so happened such
architectures became extinct at about the time the rise of 8-bit
microprocessors (and their more advanced successors) made byte-
addressability essentially universal.
C assumes byte addressibility, but it doesn't assume that bytes are 8
bits.
The PDP-10 had 36-bit words and could operate on bit fields of any size
from 1 to 36 bits. A conforming PDP-10 C compiler might have
CHAR_BIT==9, for example. But yes, it would be awkward to deal with
arrays of 6-bit quantities.
-- Keith Thompson (The_Other_Keith) Keith.S.Thompson+u@gmail.comvoid Void(void) { Void(); } /* The recursive call of the void */