Path: ...!weretis.net!feeder8.news.weretis.net!eternal-september.org!feeder3.eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail From: Lawrence D'Oliveiro Newsgroups: comp.lang.c Subject: Re: technology discussion =?UTF-8?B?4oaS?= does the world need a "new" C ? Date: Thu, 11 Jul 2024 02:51:39 -0000 (UTC) Organization: A noiseless patient Spider Lines: 24 Message-ID: References: <87plrruvmt.fsf@nosuchdomain.example.com> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Injection-Date: Thu, 11 Jul 2024 04:51:40 +0200 (CEST) Injection-Info: dont-email.me; posting-host="ead23d2d8cf5f779654345cfcdaaae64"; logging-data="2406412"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1+Kp7gBcQAv+9YJ72xqtq1a" User-Agent: Pan/0.158 (Avdiivka; ) Cancel-Lock: sha1:vs3yWBBhjGFbd55JT32o6iGfdZ4= Bytes: 2379 On Wed, 10 Jul 2024 03:16:18 -0400, James Kuyper wrote: > On 7/9/24 20:57, Lawrence D'Oliveiro wrote: > >> On Sat, 6 Jul 2024 21:34:29 -0400, James Kuyper wrote: >> >>> On many platforms, if _Alignof(type) is less than the word size, then >>> a C pointer to that type is implemented as the combination of the >>> machine address of the correct word, combined with an offset within >>> that word of the first byte of that object. >> >> Which is a terrific idea, except it cannot be carried to its logical >> conclusion (addressing of arbitrarily-aligned dynamically-defined >> bitfields) because of the requirement in the C spec that the size of a >> “byte” be at least 8 bits. > > I will grant you that I failed to mention the fact that this is a > feasible way of implementing C only on platforms with a word size of 16 > bits or longer. Don’t you think C needs a better way of handling bitfields than shift-and- mask? Many architectures have bitfield instructions, but C cannot easily make use of them without the ability to have arbitrarily-bit-aligned pointers.