View Issue Details

IDProjectCategoryView StatusLast Update
00007041003.1(2013)/Issue7+TC1System Interfacespublic2019-06-10 08:55
Reportersteffen Assigned To 
PrioritynormalSeverityEditorialTypeClarification Requested
Status ClosedResolutionAccepted As Marked 
NameSteffen Nurpmeso
Organization
User Reference
SectionXSH, chapter 3 - wordexp, wordfree
Page Number2281
Line Number72240-72243
Interp StatusApproved
Final Accepted Text0000704:0001646
Summary0000704: Clarify interoperability of wordfree(3)
DescriptionIt seems the wording of wordexp(3) / wordfree(3) permits the interpretation that wordfree(3) is only valid after a _successful_ wordexp(3) call.

(Apple Mac OS X Snow Leopard behaves that way if one globbers the wordexp_t backing memory before calling wordexp(3), whereas the checked sources of FreeBSD [since first commit 2002] and NetBSD [ditto, 2004] zero the backing memory unless WRDE_APPEND is set, as i'd expected.)
Desired ActionOn page 2281, paragraph lines 72240-72243, change, on line 72243

  In other cases, they shall not be modified.

to

  In other cases, they shall not be modified except as required for proper subsequent usage of pwordexp; i.e., a subsequent call to wordexp() with the WRDE_APPEND flag or a call to wordfree() shall behave.
Tagstc2-2008

Activities

rhansen

2013-06-06 16:15

manager   bugnote:0001646

Last edited: 2013-06-13 15:13

Interpretation response
------------------------
The standard is unclear on this issue, and no conformance distinction can be made between alternative implementations based on this. This is being referred to the sponsor.

Rationale:
-------------
The standard is clear that wordfree() can be called after any
 wordexp() call, not just successful ones (Lines 72184-72185 do
 not contain the word "successful"). However, the last sentence of
 the first paragraph of the RETURN VALUES section (line 72243)
 states: "In other cases, they shall not be modified.", but it
 is not clear whether "other cases" here refers to all cases
 other than when wordexp() returns WRDE_NOSPACE (including
 success) or just to error cases other than WRDE_NOSPACE. And,
 neither of these possibilities matches the intended behavior.

Notes to the Editor (not part of this interpretation):
-------------------------------------------------------

On page 2281 line 72243, change:

    In other cases, they shall not be modified.

to:

    In other error cases, if the WRDE_APPEND flag was specified,
    pwordexp->we_wordc and pwordexp->we_wordv shall not be modified.

Add after page 2281 line 72230:

The results are unspecified if WRDE_APPEND and WRDE_REUSE are both specified.

ajosey

2013-09-06 04:55

manager   bugnote:0001809

Interpretation Proposed 6 Sep 2013

ajosey

2013-10-14 13:07

manager   bugnote:0001892

Interpretation approved 14 October 2013

Issue History

Date Modified Username Field Change
2013-05-31 15:45 steffen New Issue
2013-05-31 15:45 steffen Name => Steffen Nurpmeso
2013-05-31 15:45 steffen Section => XSH, chapter 3 - wordexp, wordfree
2013-05-31 15:45 steffen Page Number => 2281
2013-05-31 15:45 steffen Line Number => 72240-72243
2013-06-06 16:15 rhansen Note Added: 0001646
2013-06-06 16:24 msbrown Note Edited: 0001646
2013-06-06 16:25 msbrown Note Edited: 0001646
2013-06-06 16:27 msbrown Note Edited: 0001646
2013-06-06 16:34 msbrown Note Edited: 0001646
2013-06-06 16:36 msbrown Note Edited: 0001646
2013-06-06 16:37 msbrown Interp Status => Proposed
2013-06-06 16:37 msbrown Final Accepted Text => 0000704:0001646
2013-06-06 16:37 msbrown Status New => Interpretation Required
2013-06-06 16:37 msbrown Resolution Open => Accepted As Marked
2013-06-06 16:37 msbrown Tag Attached: tc2-2008
2013-06-06 16:38 msbrown Interp Status Proposed => Pending
2013-06-13 15:12 Don Cragun Note Edited: 0001646
2013-06-13 15:13 Don Cragun Note Edited: 0001646
2013-09-06 04:55 ajosey Interp Status Pending => Proposed
2013-09-06 04:55 ajosey Note Added: 0001809
2013-10-14 13:07 ajosey Interp Status Proposed => Approved
2013-10-14 13:07 ajosey Note Added: 0001892
2019-06-10 08:55 agadmin Status Interpretation Required => Closed