| Anonymous | Login | Signup for a new account | 2010-09-03 08:44 UTC |
| Main | My View | View Issues | Change Log | Docs |
| Viewing Issue Simple Details [ Jump to Notes ] | [ Issue History ] [ Print ] | |||||||||||
| ID | Category | Severity | Type | Date Submitted | Last Update | |||||||
| 0000050 | [1003.1(2008)/Issue 7] Shell and Utilities | Objection | Clarification Requested | 2009-06-25 12:53 | 2009-10-09 15:56 | |||||||
| Reporter | geoffclare | View Status | public | |||||||||
| Assigned To | ajosey | |||||||||||
| Priority | normal | Resolution | Accepted | |||||||||
| Status | Interpretation Required | |||||||||||
| Name | Geoff Clare | |||||||||||
| Organization | The Open Group | |||||||||||
| User Reference | ||||||||||||
| Section | 2.6.4 | |||||||||||
| Page Number | 2310 | |||||||||||
| Line Number | 72861 | |||||||||||
| Interp Status | Approved | |||||||||||
| Final Accepted Text | Note: 0000228 | |||||||||||
| Summary | 0000050: acceptance of shell variables with negative values is not clear | |||||||||||
| Description |
XCU 2.6.4 states: If the shell variable x contains a value that forms a valid integer constant, then the arithmetic expansions "$((x))" and "$(($x))" shall return the same value. This seems fine at face value, but earlier in the same section is the following statement: Only the decimal-constant, octal-constant, and hexadecimal-constant constants specified in the ISO C standard, Section 6.4.4.1 are required to be recognized as constants. This statement is specifically about arithmetic expressions, but could be taken to affect the requirements about shell variable contents as well. In which case, shell variables containing negative values are not required to be supported. When clarifying this for minus signs, it is probably worth including plus signs as well. All the shells I have tried accept: x='+2'; echo $((x)) This is also consistent with the printf utility, which is required to accept constants "as described by the ISO C standard, with the following extensions: * A leading plus or minus sign shall be allowed". In addition, in the later statement: If the expression is invalid, the expansion fails and the shell shall write a message to standard error indicating the failure. it is not clear whether this only applies to the expression itself, or also to the contents of shell variables used in the expression. Since shells can, as an extension, support the use of variables with non-constant contents, the change here needs to be carefully worded so as not to imply that anything that is not a valid constant produces an error. |
|||||||||||
| Desired Action |
Change "If the shell variable x contains a value that forms a valid integer constant, then" to "If the shell variable x contains a value that forms a valid integer constant, optionally including a leading plus or minus sign, then" At line 72866, change "If the expression is invalid, the expansion fails and the shell shall write a message to standard error indicating the failure." to "If the expression is invalid, or the contents of a shell variable used in the expression are not recognized by the shell, the expansion fails and the shell shall write a diagnostic message to standard error indicating the failure." |
|||||||||||
| Tags | No tags attached. | |||||||||||
| Attached Files | ||||||||||||
|
|
||||||||||||
Issue History |
|||
| Date Modified | Username | Field | Change |
| 2009-06-25 12:53 | Don Cragun | New Issue | |
| 2009-06-25 12:53 | Don Cragun | Status | New => Under Review |
| 2009-06-25 12:53 | Don Cragun | Assigned To | => ajosey |
| 2009-06-25 12:53 | Don Cragun | Name | => Geoff Clare |
| 2009-06-25 12:53 | Don Cragun | Organization | => The Open Group |
| 2009-06-25 12:53 | Don Cragun | Section | => 2.6.4 |
| 2009-06-25 12:53 | Don Cragun | Page Number | => 2310 |
| 2009-06-25 12:53 | Don Cragun | Line Number | => 72861 |
| 2009-06-25 12:57 | Don Cragun | Note Added: 0000088 | |
| 2009-06-25 12:57 | Don Cragun | Reporter | Don Cragun => geoffclare |
| 2009-06-25 12:57 | Don Cragun | Status | Under Review => Resolved |
| 2009-06-25 12:57 | Don Cragun | Resolution | Open => Accepted |
| 2009-06-25 16:38 | Don Cragun | Tag Attached: real bug in aardvark | |
| 2009-06-26 06:30 | Don Cragun | Note Edited: 0000088 | |
| 2009-07-30 16:07 | msbrown | Tag Detached: real bug in aardvark | |
| 2009-07-30 16:09 | msbrown | Status | Resolved => Interpretation Required |
| 2009-08-11 16:22 | Don Cragun | Interp Status | => Pending |
| 2009-09-17 15:13 | ajosey | Note Added: 0000228 | |
| 2009-09-17 15:14 | ajosey | Final Accepted Text | => Note: 0000228 |
| 2009-09-17 15:41 | nick | Interp Status | Pending => Proposed |
| 2009-10-09 15:50 | ajosey | Note Edited: 0000228 | |
| 2009-10-09 15:56 | ajosey | Interp Status | Proposed => Approved |
| 2009-10-09 16:02 | ajosey | Note Edited: 0000228 | |
| Mantis 1.1.6[^] Copyright © 2000 - 2008 Mantis Group |