(My original question was going to be about "What happened to _BitInt
?" but that was based on a misreading of some cppreference pages).
The Library Introduction section 16.2 of the C++23 Draft Standard says that the C Standard library is supported in C++. The only reference to a specific C standard, however, is in a footnote (#141) in 16.3. This is to the 2018 C Standard, which doesn’t mention _BitInt
. But I found a description of _BitInt
in the draft C 23 Standard.
Does the C++23 Standard incorporate a specific version of the C Standard Library?
- If so, which one?
- If not, is there a mechanism to incorporate the libraries of future C Standards?
11
2 Answers
Quoting N4950 2.2 (the final working draft of the C++23 standard):
- The library described in ISO/IEC 9899:2018, Clause 7, is hereinafter called the C standard library3.
3 With the qualifications noted in Clause 17 through Clause 33 and in C.7, the C standard library is a subset of the C++
standard library
where ISO/IEC 9899:2018 is the C17 standard.
Note while the C++23 standard names a specific C standard, it is still possible for implementations to support features from later C editions as language extensions. For example, Clang supports C23’s _BitInt(N)
as an extension when compiling C++ code.
1
-
I will come back tomorrow and mark this as the answer.
– Spencer9 hours ago
I am not sure if I understand what you are asking. Your link to
cppreference
deals with C23, and theWikipedia
articles deals with **C++**23, and I cannot find any reference to_BitInt
in that page. Am I missing something?10 hours ago
Should that be "claim that C23 adds", not C++23?
9 hours ago
This is from the draft C++ Standard [defns.c.lib] "…library described in ISO/IEC 9899:2018, Clause 7…" – you would now need to reference the ISO number to the C Standard.
9 hours ago
@RichardCritten I think that qualifies as an answer
9 hours ago
@RichardCritten It's C17: open-std.org/jtc1/sc22/wg14/www/projects.html 🙂
9 hours ago