This page is a snapshot from the LWG issues list, see the Library Active Issues List for more information and the meaning of CD1 status.
Section: 27.4.5 [string.conversions] Status: CD1 Submitter: Daniel Krügler Opened: 2008-01-13 Last modified: 2016-01-28
Priority: Not Prioritized
View all other issues in [string.conversions].
View all issues with CD1 status.
Discussion:
The return clause 27.4.5 [string.conversions] paragraph 15 of the new to_wstring
overloads says:
Returns: each function returns a
wstringobject holding the character representation of the value of its argument that would be generated by callingwsprintf(buf, fmt, val)with a format specifier ofL"%lld",L"%ulld", orL"%f", respectively.
Problem is: There does not exist any wsprintf function in C99 (I checked
the 2nd edition of ISO 9899, and the first and the second corrigenda from
2001-09-01 and 2004-11-15). What probably meant here is the function
swprintf from <wchar.h>/<cwchar>, but this has the non-equivalent
declaration:
int swprintf(wchar_t * restrict s, size_t n, const wchar_t * restrict format, ...);
therefore the paragraph needs to mention the size_t parameter n.
Proposed resolution:
Change the current wording of 27.4.5 [string.conversions] p. 15 to:
Returns:
eEach function returns awstringobject holding the character representation of the value of its argument that would be generated by callingwith a format specifierwsswprintf(buf, bufsz, fmt, val)fmtofL"%lld",L"%ulld", orL"%f", respectively, wherebufdesignates an internal character buffer of sufficient sizebufsz.
[Hint to the editor: The resolution also adds to mention the name of the format specifier "fmt"]
I also would like to remark that the current wording of it's equivalent
paragraph 7 should also mention the meaning of buf and fmt.
Change the current wording of 27.4.5 [string.conversions] p. 7 to:
Returns:
eEach function returns a string object holding the character representation of the value of its argument that would be generated by callingsprintf(buf, fmt, val)with a format specifierfmtof"%lld","%ulld", or"%f", respectively, wherebufdesignates an internal character buffer of sufficient size.