Created on 2025-12-11.00:00:00 last changed yesterday
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.
| History | |||
|---|---|---|---|
| Date | User | Action | Args |
| 2025-12-11 08:16:01 | admin | set | messages: + msg8435 |
| 2025-12-11 00:00:00 | admin | create | |