C++ Logo

liaison

Advanced search

[wg14/wg21 liaison] Shift state immediately prior to terminating NUL of string literals

From: Hubert Tong <hubert.reinterpretcast_at_[hidden]>
Date: Fri, 29 Oct 2021 21:59:36 -0400
It seems the C standard has a rule regarding the shift state of the
spelling of string literals in the source file but neither the C standard
nor the C++ standard specify what shift state should be observed just prior
to the terminating NUL of a string literal. Is this lack of normative
encouragement or requirement for the string to be in the initial shift
state prior to the terminating NUL just a defect?

Note that NUL is required by C to be encodable in any shift state;
therefore, the need to insert NUL does not "naturally" cause strings in
non-initial shift states to return to the initial shift state.

-- HT

Received on 2021-10-29 21:00:08