Sujet : Re: "A diagram of C23 basic types"
De : tr.17687 (at) *nospam* z991.linuxsc.com (Tim Rentsch)
Groupes : comp.lang.cDate : 11. Apr 2025, 17:48:11
Autres entêtes
Organisation : A noiseless patient Spider
Message-ID : <8634eebq5w.fsf@linuxsc.com>
References : 1
User-Agent : Gnus/5.11 (Gnus v5.11) Emacs/22.4 (gnu/linux)
Alexis <
flexibeast@gmail.com> 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.