Austin Group Defect Tracker

Aardvark Mark IV


Viewing Issue Simple Details Jump to Notes ] Issue History ] Print ]
ID Category Severity Type Date Submitted Last Update
0001395 [1003.1(2016/18)/Issue7+TC2] Shell and Utilities Objection Error 2020-08-26 14:36 2021-03-25 14:22
Reporter geoffclare View Status public  
Assigned To
Priority normal Resolution Accepted As Marked  
Status Applied  
Name Geoff Clare
Organization The Open Group
User Reference
Section awk
Page Number 2486
Line Number 79925-79930
Interp Status Approved
Final Accepted Text Note: 0005225
Summary 0001395: awk radix character in alternative conversion to atof()
Description In POSIX.2-1992 awk was required to convert string values to numeric values by the equivalent of:
setlocale(LC_NUMERIC, "");
numeric_value = atof(string_value);
Later when atof() was required to support hex floating point, "INF", and "NAN", this was changed to make the support of those new things optional in awk by saying the conversion is done either as above or by an alternative conversion that is a description of how atof() used to work in C90.

At least, that's what was intended. Unfortunately, the description of this alternative conversion refers to <period> instead of the radix character.
Desired Action On page 2486 line 79925 section awk, change:
... optionally containing a <period>
to:
... optionally containing a radix character

On page 2486 line 79928 section awk, change:
The sequence starting with the first digit or the <period> (whichever occurs first) is interpreted as a floating constant of the C language, and if neither an exponent part nor a <period> appears, a <period> is assumed to follow the last digit in the string.
to:
The sequence starting with the first digit or the radix character (whichever occurs first) is interpreted as a floating constant of the C language, except that the radix character shall be used in place of a <period>, and if neither an exponent part nor a radix character appears, a radix character is assumed to follow the last digit in the string.

Tags tc3-2008
Attached Files

- Relationships

-  Notes
(0004946)
shware_systems (reporter)
2020-08-26 15:32
edited on: 2020-08-26 15:33

A floating constant of the C language, as a subset of strings in general, does presume <period> is always the radix character, according to the C grammar. POSIX extending the definition, to allow other chars, it seems should be CX shaded, in interface and utility descriptions, or these be reworded to defer directly to strtod(), which has appropriate text and shading already.

(0005225)
rhansen (manager)
2021-02-04 17:31

Interpretation response
------------------------
The standard states the requirements for string to number conversion in awk, and conforming implementations must conform to this. However, concerns have been raised about this which are being referred to the sponsor.

Rationale:
-------------
As stated in the RATIONALE the intent was to allow implementations to recognize floating-point constants according to either the ISO/IEC 9899: 1990 standard or ISO/IEC 9899: 1999 standard. The use of <period> in the text was an oversight.

Notes to the Editor (not part of this interpretation):
-------------------------------------------------------
On page 2486 line 79925 section awk, change:
... optionally containing a <period>
to:
... optionally containing a radix character


On page 2486 line 79928 section awk, change:
The sequence starting with the first digit or the <period> (whichever occurs first) is interpreted as a floating constant of the C language, and if neither an exponent part nor a <period> appears, a <period> is assumed to follow the last digit in the string.
to:
The sequence starting with the first digit or the radix character (whichever occurs first) is interpreted as a floating constant of the C language, except that the radix character shall be used in place of a <period>, and if neither an exponent part nor a radix character appears, a radix character is assumed to follow the last digit in the string.


On page 2487 lines 79966-79967, change:
Each occurrence of the decimal point character from the current locale is changed to a <period>.
to:
Each occurrence of the radix character from the current locale is changed to a <period>.


On page 2507 line 80823, add a sentence:
Note that these forms do not use the radix character from the current locale; they always use a <period>.
(0005240)
agadmin (administrator)
2021-02-16 14:36

Interpretation proposed: 16 Feb 2021
(0005289)
agadmin (administrator)
2021-03-19 11:42

Interpretation approved: 19 March 2021

- Issue History
Date Modified Username Field Change
2020-08-26 14:36 geoffclare New Issue
2020-08-26 14:36 geoffclare Name => Geoff Clare
2020-08-26 14:36 geoffclare Organization => The Open Group
2020-08-26 14:36 geoffclare Section => awk
2020-08-26 14:36 geoffclare Page Number => 2486
2020-08-26 14:36 geoffclare Line Number => 79925-79930
2020-08-26 14:36 geoffclare Interp Status => ---
2020-08-26 15:32 shware_systems Note Added: 0004946
2020-08-26 15:33 shware_systems Note Edited: 0004946
2021-02-04 17:31 rhansen Note Added: 0005225
2021-02-04 17:32 rhansen Interp Status --- => Pending
2021-02-04 17:32 rhansen Final Accepted Text => bugnot:5225
2021-02-04 17:32 rhansen Status New => Interpretation Required
2021-02-04 17:32 rhansen Resolution Open => Accepted As Marked
2021-02-04 17:32 rhansen Final Accepted Text bugnot:5225 => Note: 0005225
2021-02-04 17:33 rhansen Tag Attached: tc3-2008
2021-02-16 14:36 agadmin Interp Status Pending => Proposed
2021-02-16 14:36 agadmin Note Added: 0005240
2021-03-19 11:42 agadmin Interp Status Proposed => Approved
2021-03-19 11:42 agadmin Note Added: 0005289
2021-03-25 14:22 geoffclare Status Interpretation Required => Applied


Mantis 1.1.6[^]
Copyright © 2000 - 2008 Mantis Group
Powered by Mantis Bugtracker