View Issue Details

IDProjectCategoryView StatusLast Update
00003951003.1(2008)/Issue 7System Interfacespublic2013-04-16 13:06
Reportereblake Assigned Toajosey  
PrioritynormalSeverityEditorialTypeError
Status ClosedResolutionAccepted As Marked 
NameEric Blake
OrganizationRed Hat
User Referenceebb.getc_unlocked
Sectiongetc_unlocked
Page Number993
Line Number33331
Interp Status---
Final Accepted Text0000395:0000794
Summary0000395: getc_unlocked editorial improvements
DescriptionThe 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 ActionAt 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().
Tagstc1-2008

Relationships

related to 0000118 Closedajosey flockfile() says "all functions" but should exclude *_unlocked() 

Activities

geoffclare

2011-03-17 16:58

manager   bugnote:0000711

The change to flockfile() is already covered by bug 0000118

msbrown

2011-05-26 15:29

manager   bugnote:0000794

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().

Issue History

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