A NOTE has been added to this issue. 
====================================================================== 
https://austingroupbugs.net/view.php?id=1784 
====================================================================== 
Reported By:                kre
Assigned To:                
====================================================================== 
Project:                    Issue 8 drafts
Issue ID:                   1784
Category:                   Shell and Utilities
Type:                       Error
Severity:                   Objection
Priority:                   normal
Status:                     New
Name:                       Robert Elz 
Organization:                
User Reference:              
Section:                    XCU 3 / getopts 
Page Number:                2955 - 2959 
Line Number:                98803  - 98966 
Final Accepted Text:         
====================================================================== 
Date Submitted:             2023-10-22 06:14 UTC
Last Modified:              2023-10-28 05:19 UTC
====================================================================== 
Summary:                    getopts specification needs fixing (multiple issues)
======================================================================
Relationships       ID      Summary
----------------------------------------------------------------------
related to          0001535 Poor description of declaration (all re...
related to          0001393 'command' should not be treated as a de...
parent of           0000351 certain shell special built-ins should ...
====================================================================== 

---------------------------------------------------------------------- 
 (0006555) kre (reporter) - 2023-10-28 05:19
 https://austingroupbugs.net/view.php?id=1784#c6555 
---------------------------------------------------------------------- 
I have just realised there is yet another problem with the spec of getopts
beyond those above...

On page 2955 (lines 98843...) - right at the bottom of that page (which is
the first page of the getopts spec) it says:

   Any other attempt to invoke getopts multiple times in a single shell
   execution environment with parameters (positional parameters or arg
   operands) that are not the same in all invocations, or with an OPTIND
   value modified to be a value other than 1, produces unspecified
results.

The problem is that final "or with an OPTIND value modified..." as the
spec actually requires that getopts modify OPTIND each time it is invoked,
and some of those modifications will be to values other than 1 (and the
application cannot know, in advance, when that will happen).   In effect
that sentence (the "produces unspecified results") means that every
invocation of getopts, other than the first after OPTIND has been
initialised to 1, is potentially unspecified.

I suspect what this sentence meant to say was "or with an OPTIND value
modified by the application to be a value other than 1," - but that isn't
what it currently says. 

Issue History 
Date Modified    Username       Field                    Change               
====================================================================== 
2023-10-22 06:14 kre            New Issue                                    
2023-10-22 06:14 kre            Name                      => Robert Elz      
2023-10-22 06:14 kre            Section                   => XCU 3 / getopts 
2023-10-22 06:14 kre            Page Number               => 2955 - 2959     
2023-10-22 06:14 kre            Line Number               => 98803  - 98966  
2023-10-22 06:40 kre            Tag Attached: issue8                         
2023-10-28 05:08 Don Cragun     Relationship added       related to 0001535  
2023-10-28 05:10 Don Cragun     Relationship added       related to 0001393  
2023-10-28 05:10 Don Cragun     Relationship added       parent of 0000351   
2023-10-28 05:19 kre            Note Added: 0006555                          
======================================================================


  • [Issue 8 dra... Austin Group Bug Tracker via austin-group-l at The Open Group
    • [Issue ... Austin Group Bug Tracker via austin-group-l at The Open Group
    • [Issue ... Austin Group Bug Tracker via austin-group-l at The Open Group
    • [Issue ... Austin Group Bug Tracker via austin-group-l at The Open Group
    • [Issue ... Austin Group Bug Tracker via austin-group-l at The Open Group
    • [Issue ... Austin Group Bug Tracker via austin-group-l at The Open Group
    • [Issue ... Austin Group Bug Tracker via austin-group-l at The Open Group
    • [Issue ... Austin Group Bug Tracker via austin-group-l at The Open Group
    • [Issue ... Austin Group Bug Tracker via austin-group-l at The Open Group
    • [Issue ... Austin Group Bug Tracker via austin-group-l at The Open Group
    • [Issue ... Austin Group Bug Tracker via austin-group-l at The Open Group
    • [Issue ... Austin Group Bug Tracker via austin-group-l at The Open Group
    • [Issue ... Austin Group Bug Tracker via austin-group-l at The Open Group
    • [Issue ... Austin Group Bug Tracker via austin-group-l at The Open Group
    • [Issue ... Austin Group Bug Tracker via austin-group-l at The Open Group

Reply via email to