Anonymous | Login | 2024-12-12 00:21 UTC |
Main | My View | View Issues | Change Log | Docs |
Viewing Issue Simple Details [ Jump to Notes ] | [ Issue History ] [ Print ] | ||||||
ID | Category | Severity | Type | Date Submitted | Last Update | ||
0001643 | [1003.1(2016/18)/Issue7+TC2] System Interfaces | Editorial | Error | 2023-03-21 11:13 | 2024-06-11 09:07 | ||
Reporter | bhaible | View Status | public | ||||
Assigned To | |||||||
Priority | normal | Resolution | Accepted | ||||
Status | Closed | ||||||
Name | Bruno Haible | ||||||
Organization | GNU | ||||||
User Reference | |||||||
Section | fprintf | ||||||
Page Number | 913 | ||||||
Line Number | 30960 | ||||||
Interp Status | --- | ||||||
Final Accepted Text | |||||||
Summary | 0001643: fprintf %lc: wrong reference to the current conversion specification | ||||||
Description |
The reference to "the wint_t argument to the ls conversion specification" makes no sense, since an ls conversion specification takes a wchar_t* argument. In ISO C 99 this paragraph reads "If an l length modifier is present, the wint_t argument is converted as if by an ls conversion specification with no precision and an argument that points to the initial element of a two-element array of wchar_t, the first element containing the wint_t argument to the lc conversion specification and the second a null wide character." So, apparently POSIX and ISO C 99 are based on a common ancestor document, and the reference to "ls" has been corrected in ISO C 99, i.e. changed to "lc". |
||||||
Desired Action | Change "the wint_t argument to the ls conversion specification" to "the wint_t argument to the lc conversion specification". | ||||||
Tags | applied_after_i8d3, tc3-2008 | ||||||
Attached Files | |||||||
|
Relationships | ||||||
|
Notes | |
(0006214) eblake (manager) 2023-03-21 15:44 |
For my own reference as much as anything else, Bruno found this while reporting a corner-case bug in glibc's printf(): https://sourceware.org/bugzilla/show_bug.cgi?id=30257 [^] and which he found to be also present in most other tested libc except musl. Namely, narrow printf("%lc", (wint_t)0) is surprisingly required to produce 0 bytes instead of the multibyte sequence for the null character, because that is the behavior of %ls with no precision when handed a wchar_t array with a null character in the first index; and this behavior is both different than the wprintf behavior, and from the %c behavior with a NUL byte. |
Mantis 1.1.6[^] Copyright © 2000 - 2008 Mantis Group |