This is an unofficial snapshot of the ISO/IEC JTC1 SC22 WG21 Core Issues List revision 119a. See http://www.open-std.org/jtc1/sc22/wg21/ for the official list.
2025-12-20
(From submission #828.)
After C++ was rebased on C23, the statement in C.7.6 [diff.dcl] paragraph 12 that the type of enumerators in C is int is no longer correct (see WG14 N3029 and WG14 N3030).
Possible resolution:
Change in C.7.6 [diff.dcl] paragraph 12 as follows:
Affected subclause: 9.8.1 [dcl.enum]
Change: In C++, the type of an enumerator is its enumeration. In C, the type of an enumerator is int or another integer type.
[Example 10:enum e { A }; void f() { auto x = A; int *p = &x; // valid C, invalid C++ }—end example]sizeof(A) == sizeof(int) // in C sizeof(A) == sizeof(e) // in C++ /* and sizeof(int) is not necessarily equal to sizeof(e) */
Rationale: In C++, an enumeration is a distinct type.
Effect on original feature: Change to semantics of well-defined feature.
Difficulty of converting: Semantic transformation.
How widely used: Seldom.The only time this affects existing C code is when the size of an enumerator is taken. Taking the size of an enumerator is not a common C coding practice.