View Issue Details
ID | Project | Category | View Status | Date Submitted | Last Update |
---|---|---|---|---|---|
0000894 | 1003.1(2013)/Issue7+TC1 | System Interfaces | public | 2014-11-15 06:05 | 2019-06-10 08:54 |
Reporter | dalias | Assigned To | |||
Priority | normal | Severity | Editorial | Type | Clarification Requested |
Status | Closed | Resolution | Accepted As Marked | ||
Name | Rich Felker | ||||
Organization | musl libc | ||||
User Reference | |||||
Section | fprintf | ||||
Page Number | 902 | ||||
Line Number | 30242-30243 | ||||
Interp Status | --- | ||||
Final Accepted Text | 0000894:0002570 | ||||
Summary | 0000894: Missing text clarifying %#.0o format | ||||
Description | The ISO C text (7.19.6.1 paragraph 6 in C99+TC3) for the '#' modifier character contains a parenthetical remark seen below clarifying that, in the case where the requirements of '#' (leading 0) and explicit zero precision (no characters) conflict, the '#' wins: "The result is converted to an ''alternative form''. For o conversion, it increases the precision, if and only if necessary, to force the first digit of the result to be a zero (if the value and precision are both 0, a single 0 is printed)." The corresponding POSIX text is missing this remark, and reads: "Specifies that the value is to be converted to an alternative form. For o conversion, it increases the precision (if necessary) to force the first digit of the result to be zero." Thus, to someone reading only the POSIX text, it's ambiguous what the output should be given something like: printf("%#.0o", 0); | ||||
Desired Action | Add the parenthetical remark from the ISO C text. | ||||
Tags | tc2-2008 |
|
On Page: 902 Line: 30242-30243 Change: For <tt>o</tt> conversion, it increases the precision (if necessary) to force the first digit of the result to be zero. to: For <tt>o</tt> conversion, it shall increase the precision, if and only if necessary, to force the first digit of the result to be a zero (if the value and precision are both 0, a single 0 is printed). Make the same change on Page: 983 Line: 33180 Section: fwprintf(). |
|
I noticed that the same change is needed for fwprintf(), so I have edited 0000894:0002570 to add this change. It seems like a no-brainer, so I did not feel the need to reopen the bug. |
Date Modified | Username | Field | Change |
---|---|---|---|
2014-11-15 06:05 | dalias | New Issue | |
2014-11-15 06:05 | dalias | Name | => Rich Felker |
2014-11-15 06:05 | dalias | Organization | => musl libc |
2014-11-15 06:05 | dalias | Section | => fprintf |
2014-11-15 06:05 | dalias | Page Number | => unknown |
2014-11-15 06:05 | dalias | Line Number | => unknown |
2015-02-26 17:22 | geoffclare | Note Added: 0002570 | |
2015-02-26 17:23 | geoffclare | Page Number | unknown => 902 |
2015-02-26 17:23 | geoffclare | Line Number | unknown => 30242-30243 |
2015-02-26 17:23 | geoffclare | Interp Status | => --- |
2015-02-26 17:23 | geoffclare | Final Accepted Text | => 0000894:0002570 |
2015-02-26 17:23 | geoffclare | Status | New => Resolved |
2015-02-26 17:23 | geoffclare | Resolution | Open => Accepted As Marked |
2015-02-26 17:23 | geoffclare | Tag Attached: tc2-2008 | |
2015-03-26 10:57 | geoffclare | Note Edited: 0002570 | |
2015-03-26 12:08 | geoffclare | Note Added: 0002604 | |
2019-06-10 08:54 | agadmin | Status | Resolved => Closed |