Sujet : Re: "A diagram of C23 basic types"
De : Keith.S.Thompson+u (at) *nospam* gmail.com (Keith Thompson)
Groupes : comp.lang.cDate : 08. Apr 2025, 22:46:34
Autres entêtes
Organisation : None to speak of
Message-ID : <87h62ys4w5.fsf@nosuchdomain.example.com>
References : 1 2 3 4
User-Agent : Gnus/5.13 (Gnus v5.13)
bart <
bc@freeuk.com> writes:
On 05/04/2025 18:56, Philipp Klaus Krause wrote:
Am 02.04.25 um 11:57 schrieb bart:
* Where are the fixed-width types from stdint.h?
Same as for size_t, etc: They don't exist. Those are not separate
types, just typedefs to some other types. E.g. uint16_t could be
typedef'ed to unsigned int.
>
This is the point I made a few weeks back, but others insisted they
were part of C:
Of course they're part of C. Nobody has said they aren't.
I disagree with Philipp's statement that they "don't exist", but the
rest of what he said is accurate.
Specifically, they're part of the C library, not part of the core
language. They're mentioned in section 7 of the standard, not in 6.2.5,
which describes types. They are (typically, probably always) definedd
as typedefs, aliases for other types, leading in one or more steps to the
predefined types described in 6.2.5 (or to extended integer types).
Me:
stdint.h et al are just ungainly bolt-ons, not fully supported by the
language.
>
Keith Thompson:
>
No, they're fully supported by the language. They've been in the ISO
standard since 1999.
>
This is an exchange posted on 20-Mar-2025 at 19:10 GMT (header shows
'Thu, 20 Mar 2025 12:10:22 -0700')
Right. Your claim that they're "not fully supported by the language" is
wrong (unless you restrict "language" to section 6 of the standard for
some reason).
int is defined in section 6. size_t is defined in section 7. Of course
you know all this and are pretending to be troubled by it.
Clearly, they're not quite as fully supported as short, int etc; they
are usually just aliases. But that needn't stop them being shown on
such a chart.
Apparently the author of the chart chose to include types that are
defined by the core language, not by the library. I think that was a
perfectly valid choice. Adding all the types specified in the library
would make the chart far too big and not much more informative.
If you don't like it, make your own chart.
-- Keith Thompson (The_Other_Keith) Keith.S.Thompson+u@gmail.comvoid Void(void) { Void(); } /* The recursive call of the void */