View Issue Details

IDProjectCategoryView StatusLast Update
00013951003.1(2016/18)/Issue7+TC2Shell and Utilitiespublic2024-06-11 09:08
Reportergeoffclare Assigned To 
PrioritynormalSeverityObjectionTypeError
Status ClosedResolutionAccepted As Marked 
NameGeoff Clare
OrganizationThe Open Group
User Reference
Sectionawk
Page Number2486
Line Number79925-79930
Interp StatusApproved
Final Accepted Text0001395:0005225
Summary0001395: awk radix character in alternative conversion to atof()
DescriptionIn 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 ActionOn 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.

Tagstc3-2008

Activities

shware_systems

2020-08-26 15:32

reporter   bugnote:0004946

Last edited: 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.

rhansen

2021-02-04 17:31

manager   bugnote:0005225

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>.

agadmin

2021-02-16 14:36

administrator   bugnote:0005240

Interpretation proposed: 16 Feb 2021

agadmin

2021-03-19 11:42

administrator   bugnote:0005289

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 => 0001395: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
2024-06-11 09:08 agadmin Status Applied => Closed