Title
Impossible return clause in [string.conversions]
Status
cd1
Section
[string.conversions]
Submitter
Daniel Krügler

Created on 2008-01-13.00:00:00 last changed 172 months ago

Messages

Date: 2010-10-21.18:28:33

Proposed resolution:

Change the current wording of [string.conversions] p. 15 to:

Returns: eEach function returns a wstring object holding the character representation of the value of its argument that would be generated by calling wsswprintf(buf, bufsz, fmt, val) with a format specifier fmt of L"%lld", L"%ulld", or L"%f", respectively, where buf designates an internal character buffer of sufficient size bufsz.

[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 [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 calling sprintf(buf, fmt, val) with a format specifier fmt of "%lld", "%ulld", or "%f", respectively, where buf designates an internal character buffer of sufficient size.

Date: 2008-01-13.00:00:00

The return clause [string.conversions] paragraph 15 of the new to_wstring overloads says:

Returns: each function returns a wstring object holding the character representation of the value of its argument that would be generated by calling wsprintf(buf, fmt, val) with a format specifier of L"%lld", L"%ulld", or L"%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.

History
Date User Action Args
2010-10-21 18:28:33adminsetmessages: + msg3719
2008-01-13 00:00:00admincreate