CWG Issue 1796 (original) (raw)
This is an unofficial snapshot of the ISO/IEC JTC1 SC22 WG21 Core Issues List revision 118e. See http://www.open-std.org/jtc1/sc22/wg21/ for the official list.
2025-11-05
1796. Is all-bits-zero for null characters a meaningful requirement?
Section: 5.3.1 [lex.charset]Status: CD4Submitter: Tony van EerdDate: 2013-10-02
[Moved to DR at the November, 2014 meeting.]
According to 5.3.1 [lex.charset] paragraph 3,
The basic execution character set and the basic execution wide-character set shall each contain all the members of the basic source character set, plus control characters representing alert, backspace, and carriage return, plus a_null character_ (respectively, null wide character), whose representation has all zero bits.
It is not clear that a portable program can examine the bits of the representation; instead, it would appear to be limited to examining the bits of the numbers corresponding to the value representation (6.9.2 [basic.fundamental] paragraph 1). It might be more appropriate to require that the null character value compare equal to 0 or '\0' rather than specifying the bit pattern of the representation.
There is a similar issue for the definition of shift, bitwiseand, and bitwise or operators: are those specifications constraints on the bit pattern of the representation or on the values resulting from the interpretation of those patterns as numbers?
Proposed resolution (February, 2014):
Change 5.3.1 [lex.charset] paragraph 3 as follows:
The basic execution character set and the basic execution wide-character set shall each contain all the members of the basic source character set, plus control characters representing alert, backspace, and carriage return, plus a null character(respectively, null wide character), whose
representation has all zero bitsvalue is 0. For each basic execution character set...