This is an unofficial snapshot of the ISO/IEC JTC1 SC22 WG21 Core Issues List revision 120c. See http://www.open-std.org/jtc1/sc22/wg21/ for the official list.
2026-08-21
(From submission #914.)
C++ does not have a requirement that an integer value 0 is represented as all-zero bits in the value representation; C does. See C23 6.2.6.2 paragraph 3:
... For any integer type, the object representation where all the bits are zero shall be a representation of the value zero in that type.
Suggested resolution [SUPERSEDED]:
Add a section in C.8.3 [diff.basic] as follows:
Affected subclause: 6.9.3 [basic.fundamental]
Change: C++ has relaxed rules for the representation of integer types compared to C.
[ Example: With the assumption that int has no padding bits:int i = 0; unsigned char a[sizeof(int)] = {}; assert(memcmp(&i, a, sizeof(i)) == 0); // guaranteed to hold in C; may fail in C++-- end example]
Rationale: C++ has a more elaborate value model that de-emphasizes access to object representations.
Effect on original feature: Change of semantics of well-defined feature.
Difficulty of converting: Semantic transformation. Aggregate initialization should be used in lieu of memset.
How widely used: Occasionally. In particular, calloc and memset are expected to yield scalar subobjects with value 0.
CWG 2026-06-26
In lieu of the above suggested resolution, CWG opted to eliminate this difference vs. C.
Possible resolution:
Change in 6.9.3 [basic.fundamental] paragraph 11 as follows:
The types char, wchar_t, char8_t, char16_t, and char32_t are collectively called character types. The character types, bool, the signed and unsigned integer types, and cv-qualified versions (6.9.6 [basic.type.qualifier]) thereof, are collectively termed integral types. A synonym for integral type is integer type.
[Note 8: Enumerations (9.8.1 [dcl.enum]) are not integral; however, unscoped enumerations can be promoted to integral types as specified in 7.3.7 [conv.prom]. —end note]
If the bits in the value representation of an object of integer type all have value zero, the object contains the value false if it is of type bool and zero otherwise.