This is an unofficial snapshot of the ISO/IEC JTC1 SC22 WG21 Core Issues List revision 116a. See http://www.open-std.org/jtc1/sc22/wg21/ for the official list.
2024-12-19
[Voted into WP at October, 2009 meeting.]
Clause 15 [cpp] refers in several places to “character string literals” without specifying whether they are narrow or wide strings. For instance, what kind of string does the # operator (15.6.3 [cpp.stringize]) produce?
15.7 [cpp.line] paragraph 1 says,
The string literal of a #line directive, if present, shall be a character string literal.
Is “character string literal” intended to mean a narrow string literal? (Also, there is no string-literal mentioned in the grammatical descriptions of #line; paragraph 4 reads,
which is apparently intended to suggest a string literal but does not use the term.)
15.11 [cpp.predefined] should also specify what kind of character string literals are produced by the various string-valued predefined macros.
Notes from the July, 2007 meeting:
The CWG affirmed that all the string literals mentioned in Clause 15 [cpp] are intended to be narrow strings.
Proposed resolution (September, 2008)
Change the footnote in Clause 15 [cpp] paragraph 1 as follows:
Thus, preprocessing directives are commonly called “lines.” These “lines” have no other syntactic significance, as all white space is equivalent except in certain situations during preprocessing (see the #characterstring literal creation operator in 15.6.3 [cpp.stringize], for example).
Change 15.6.3 [cpp.stringize] paragraph 2 as follows:
If, in the replacement list, a parameter is immediately preceded by a # preprocessing token, both are replaced by a singlecharacterordinary string literal (5.13.5 [lex.string]) preprocessing token that contains the spelling of the preprocessing token sequence for the corresponding argument... Otherwise, the original spelling of each preprocessing token in the argument is retained in thecharacterordinary string literal, except for special handling for producing the spelling of string literals and character literals: a \ character is inserted before each " and \ character of a character literal or string literal (including the delimiting " characters). If the replacement that results is not a validcharacterordinary string literal, the behavior is undefined. Thecharacterordinary string literal corresponding to an empty argument is "". The order of evaluation of # and ## operators is unspecified.
Change 15.6.6 [cpp.scope] paragraph 6 as follows:
To illustrate the rules for creatingcharacterordinary string literals and concatenating tokens, the sequence... or, after concatenation of thecharacterordinary string literals...
Change 15.7 [cpp.line] paragraph 1 as follows:
The string literal of a #line directive, if present, shall bea characteran ordinary string literal.
Change 15.7 [cpp.line] paragraph 4 as follows:
...and changes the presumed name of the source file to be the contents of thecharacterordinary string literal.
Change 15.11 [cpp.predefined] paragraph 1 as follows:
__DATE__
The date of translation of the source file (
a characteran ordinary string literal of the form...__FILE__
The presumed name of the source file (
a characteran ordinary string literal)....
__TIME__
The time of translation of the source file (
a characteran ordinary string literal of the form...
Notes from the September, 2008 meeting:
The proposed resolution will be discussed with the C Committee before proceeding, as it is expected that the next revision of the C Standard will also adopt new forms of string literals.
Additional notes (May, 2009):
At its most recent meeting, the C Committee decided to keep the existing term, “character string literal.”
One possibility for maintaining compatible phraseology with the C Standard would be to replace the occurrences of “ordinary string literal” in 5.13.5 [lex.string] with “character string literal,” instead of the extensive set of changes above.
Another possibility would be to leave the references in Clause 15 [cpp] unchanged and just insert a prefatory comment near the beginning that every occurrence of “character string literal” refers to a string-literal with no prefix. (The use of “ordinary string literal” in the preceding edits is problematic in that the phrase includes raw string literals as well as unprefixed literals.)
Proposed resolution (July, 2009):
Change 15.6.3 [cpp.stringize] paragraph 2 as follows:
A character string literal is a string-literal with no prefix. If, in the replacement list, a parameter is immediately preceded by a # preprocessing token...
Change the fifteenth bullet of Annex Clause Annex B [implimits] paragraph 2 as follows: