View Issue Details

IDProjectCategoryView StatusLast Update
00004522008-TC1System Interfacespublic2011-06-15 14:58
Reportereblake Assigned Toajosey  
PrioritynormalSeverityObjectionTypeOmission
Status ClosedResolutionDuplicate 
Product VersionDraft 1 
NameEric Blake
OrganizationRed Hat
User Referenceebb.unget
SectionXSH/TC1/D1/0083
Page Number60
Line Number2099
Interp Status---
Final Accepted Text
Summary0000452: fflush changes need counterpart unget[w]c changes
DescriptionThe proposed changes to fflush:

... the file offset of the underlying open file description shall be set
to the file position of the stream, and any characters pushed back onto
the stream by ungetc() or ungetwc() that have not subsequently been read
from the stream shall be discarded.

have clear rationale presented in bug 87 (that is, for proper behavior
of { app1; app2; } < seekable, if app1 reads one byte too many then uses
ungetc() to push it back before exiting, then app2 must start at the
offset unused by app1). However, that wording is in conflict with
existing wording in ungetc:

[XSH 67927] The value of the file-position indicator for the stream after
reading or discarding all pushed-back bytes shall be the same as it was
before the bytes were pushed back.

For the change to be complete, we also need to modify the wording of
ungetc and ungetwc to make it clear that discarded push-back characters
reset the file offset to the same offset in use while the push-back
characters were pending, and not the offset that was reached prior to
the push-back operation.
Desired ActionAt page 141 of draft 1, insert new change actions in the appropriate positions:

On Page: 2151 Line: 67927 Section: ungetc()
In the DESCRIPTION section, change from:
The value of the file-position indicator for the stream after reading
or discarding all pushed-back bytes shall be the same as it was before
the bytes were pushed back.
to:
The value of the file-position indicator for the stream after reading
all pushed-back bytes shall be the same as it was before the bytes were
pushed back.
Rationale: Pushed-back bytes discarded by fflush() are re-read from a
seekable underlying file, rather than skipped.

On Page: 2152 Line: 67971 Section: ungetwc()
In the DESCRIPTION section, change from:
The value of the file-position indicator for the stream after reading
or discarding all pushed-back characters shall be the same as it was
before the characters were pushed back.
to:
The value of the file-position indicator for the stream after reading
all pushed-back characters shall be the same as it was before the
characters were pushed back.
Rationale: Pushed-back characters discarded by fflush() are re-read
from a seekable underlying file, rather than skipped.
TagsNo tags attached.

Relationships

related to 0000087 Closedajosey 1003.1(2008)/Issue 7 fflush and ungetc 
related to 0000093 Closedajosey 1003.1(2008)/Issue 7 ungetc fseeko 

Activities

eblake

2011-05-23 19:45

manager   bugnote:0000790

Additionally:

At line 4853 [XSH/TC1/D1/0331 ungetc], change:

fseek(), [CX]fseeko()[/CX] fsetpos(), or rewind()

to:

[CX]fflush()[/CX], fseek(), [CX]fseeko()[/CX] fsetpos(), or rewind()


At line 4864 [XSH/TC1/D1/0332 ungetwc], change:

fseek(), [CX]fseeko()[/CX] fsetpos(), or rewind()

to:

[CX]fflush()[/CX], fseek(), [CX]fseeko()[/CX] fsetpos(), or rewind()

Don Cragun

2011-06-15 14:58

manager   bugnote:0000835

This bug affects the changes instituted for an approved interpretation 0000087 so this bug is closed as a duplicate of it and it is being reopened.

Issue History

Date Modified Username Field Change
2011-05-23 16:53 eblake New Issue
2011-05-23 16:53 eblake Status New => Under Review
2011-05-23 16:53 eblake Assigned To => ajosey
2011-05-23 16:53 eblake Name => Eric Blake
2011-05-23 16:53 eblake Organization => Red Hat
2011-05-23 16:53 eblake User Reference => ebb.unget
2011-05-23 16:53 eblake Section => XSH/TC1/D1/0083
2011-05-23 16:53 eblake Page Number => 60
2011-05-23 16:53 eblake Line Number => 2099
2011-05-23 16:53 eblake Interp Status => ---
2011-05-23 16:57 eblake Relationship added related to 0000087
2011-05-23 19:45 eblake Note Added: 0000790
2011-05-23 19:45 eblake Relationship added related to 0000093
2011-06-15 14:58 Don Cragun Note Added: 0000835
2011-06-15 14:58 Don Cragun Status Under Review => Closed
2011-06-15 14:58 Don Cragun Resolution Open => Duplicate