Sujet : Re: "A diagram of C23 basic types"
De : bc (at) *nospam* freeuk.com (bart)
Groupes : comp.lang.cDate : 02. Apr 2025, 10:57:29
Autres entêtes
Organisation : A noiseless patient Spider
Message-ID : <vsj1m8$1f8h2$1@dont-email.me>
References : 1
User-Agent : Mozilla Thunderbird
On 02/04/2025 06:59, Alexis wrote:
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/
So much for C being a 'simple' language.
However the chart seems unnecessarily over-elaborate in some areas, while missing some features:
* I thought that enumerations could now have their own integer type
* Where are the fixed-width types from stdint.h?
* How does unsigned BitInt end up as a signed bit-precise version?
* What about bit-fields?
I also have trouble with 'basic type' used for BitInt which could be arbitrarily large, or for Complex types. Could they also end up as Scalars? It's hard to see when the coloured lines should be followed.
Anyway, the good thing is that if I now look at an Ada type hierarchy, it appears simple by comparison!
All enumeration/integer types end up as Discrete, and all float types as Real; together they are Scalars.