Path: ...!eternal-september.org!feeder3.eternal-september.org!news.eternal-september.org!eternal-september.org!.POSTED!not-for-mail
From: Tim Rentsch
Newsgroups: comp.lang.c
Subject: Re: "A diagram of C23 basic types"
Date: Fri, 11 Apr 2025 09:48:11 -0700
Organization: A noiseless patient Spider
Lines: 27
Message-ID: <8634eebq5w.fsf@linuxsc.com>
References: <87y0wjaysg.fsf@gmail.com>
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Injection-Date: Fri, 11 Apr 2025 18:48:18 +0200 (CEST)
Injection-Info: dont-email.me; posting-host="71ab0539a1cf710e3caa6c34edacc1d7";
logging-data="2122660"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX18G6/lDuZ4AZQRuUQBkgDF1pZOIImArIpo="
User-Agent: Gnus/5.11 (Gnus v5.11) Emacs/22.4 (gnu/linux)
Cancel-Lock: sha1:qi2zluTZWx98NF8/zdypCCSFkT0=
sha1:pztKCntCyvWNqO3KvavEp/PjCxY=
Bytes: 2296
Alexis writes:
> Thought people here might be interested in this image on Jens Gustedt's
> blog, which translates section 6.2.5, "Types", of the C23 standard
> into a graph of inclusions:
>
> https://gustedt.wordpress.com/2025/03/29/a-diagram-of-c23-basic-types/
By the way, regarding the question of why types like size_t are not
in the diagram, there is a simple explanation. All the types shown
in the diagram are guaranteed to be distinct.[*] Types like size_t,
ptrdiff_t, and so forth, are not new types, but simply different
names for a type already represented in the diagram.
[*] This statement assumes that a bit-precise type whose width
matches one of the standard integer types is still a distinct type.
I don't know if C23 actually follows that rule.
Editorial comment: my understanding is that there is an asymmetry
regarding the bit-precise types, in that there is an unsigned
bit-precise type of width 1, but not a signed bit-precise type of
width 1. Assuming that is so, IMO it is a galactically stupid
omission: a signed bit-precise integer of width 1 would very
naturally hold the two values 0 and -1, which is a useful type to
have in some circumstances, and symmetry would be preserved.
Someone didn't have their Wheaties that morning when that decision
was made.