View Issue Details
ID | Project | Category | View Status | Date Submitted | Last Update |
---|---|---|---|---|---|
0000395 | 1003.1(2008)/Issue 7 | System Interfaces | public | 2011-03-17 16:43 | 2013-04-16 13:06 |
Reporter | eblake | Assigned To | ajosey | ||
Priority | normal | Severity | Editorial | Type | Error |
Status | Closed | Resolution | Accepted As Marked | ||
Name | Eric Blake | ||||
Organization | Red Hat | ||||
User Reference | ebb.getc_unlocked | ||||
Section | getc_unlocked | ||||
Page Number | 993 | ||||
Line Number | 33331 | ||||
Interp Status | --- | ||||
Final Accepted Text | 0000395:0000794 | ||||
Summary | 0000395: getc_unlocked editorial improvements | ||||
Description | The standard requires that all macros evaluate their arguments exactly once unless stated otherwise (XSH 2.1, lines 15868 and 15883). The application usage for the *_unlocked functions warns users that a macro might multiply evaluate an argument, but this is non-normative. Since the description combines text for both getc_unlocked() (the counterpart getc() allows multiple evaluation) and putchar_unlocked (the counterpart putchar() does not allow multiple evaluation), it would not hurt to add an explicit statement on which of these interfaces may have the same exception as their locked counterpart when implemented as a macro. Meanwhile, there is an incorrect statement in flockfile(), claiming that all functions that operate on FILE* are locked. There is no cross-reference from getc_unlocked() to flockfile(), even though it is mentioned in the normative text. Finally, the application usage has an incorrect use of putc_unlocked. | ||||
Desired Action | At line 25811 [XSH flockfile DESCRIPTION], after "All functions that reference (FILE *) objects", insert the phrase ", except those with the _unlocked suffix,". At line 33318 [XSH getc_unlocked DESCRIPTION], after "in a thread-safe manner", add a sentence: "If getc_unlocked or putc_unlocked are implemented as macros they may evaluate stream more than once, so the stream argument should never be an expression with side-effects." At line 33331 [XSH getc_unlocked APPLICATION USAGE], change "putc_unlocked(*f++)" to "putc_unlocked(c,*f++)". At line 33375 [XSH getc_unlocked SEE ALSO], add a reference to flockfile(). | ||||
Tags | tc1-2008 |
|
The change to flockfile() is already covered by bug 0000118 |
|
This is the new resolved set of actions: After line 33321 [XSH getc_unlocked DESCRIPTION], add a new paragraph: "If getc_unlocked or putc_unlocked are implemented as macros they may evaluate stream more than once, so the stream argument should never be an expression with side-effects." At line 33331 [XSH getc_unlocked APPLICATION USAGE], change "putc_unlocked(*f++)" to "putc_unlocked(c,*f++)". At line 33375 [XSH getc_unlocked SEE ALSO], add a reference to flockfile(). |
Date Modified | Username | Field | Change |
---|---|---|---|
2011-03-17 16:43 | eblake | New Issue | |
2011-03-17 16:43 | eblake | Status | New => Under Review |
2011-03-17 16:43 | eblake | Assigned To | => ajosey |
2011-03-17 16:43 | eblake | Name | => Eric Blake |
2011-03-17 16:43 | eblake | Organization | => Red Hat |
2011-03-17 16:43 | eblake | User Reference | => ebb.getc_unlocked |
2011-03-17 16:43 | eblake | Section | => getc_unlocked |
2011-03-17 16:43 | eblake | Page Number | => 993 |
2011-03-17 16:43 | eblake | Line Number | => 33331 |
2011-03-17 16:43 | eblake | Interp Status | => --- |
2011-03-17 16:50 | nick | Tag Attached: c99 | |
2011-03-17 16:58 | geoffclare | Note Added: 0000711 | |
2011-05-26 15:22 | nick | Tag Detached: c99 | |
2011-05-26 15:26 | msbrown | Relationship added | related to 0000118 |
2011-05-26 15:29 | msbrown | Note Added: 0000794 | |
2011-05-26 15:29 | msbrown | Status | Under Review => Resolved |
2011-05-26 15:29 | msbrown | Resolution | Open => Accepted As Marked |
2011-05-26 15:30 | msbrown | Final Accepted Text | => 0000395:0000794 |
2011-05-26 15:31 | msbrown | Tag Attached: tc1-2008 | |
2013-04-16 13:06 | ajosey | Status | Resolved => Closed |