Fixes are available
XL C/C++ for AIX Fix Pack 1 (September 2014 PTF) for 13.1
XL C/C++ for AIX Fix Pack 2 (December 2014 PTF) for 13.1
XL C/C++ for AIX Fix Pack 3 (April 2015 PTF) for 13.1
XL C/C++ for AIX Fix Pack 4 (July 2015 PTF) for 13.1
XL C for AIX Fix Pack 5 (November 2015 Update) for 13.1
XL C/C++ for AIX Fix Pack 5 (November 2015 PTF) for 13.1
XL C/C++ for AIX Fix Pack 6 (February 2016 PTF) for 13.1
XL C for AIX Fix Pack 6 (February 2016 Update) for 13.1
XL C for AIX Fix Pack 7 (May 2016 Update) for 13.1
XL C/C++ for AIX Fix Pack 7 (May 2016 PTF) for 13.1
XL C for AIX Fix Pack 8 (August 2016 Update) for 13.1
XL C/C++ for AIX Fix Pack 8 (August 2016 PTF) for 13.1
XL C for AIX Fix Pack 9 (June 2017 Update) for 13.1
XL C/C++ for AIX Fix Pack 9 (June 2017 PTF) for 13.1
XL C for AIX Fix Pack 10 (February 2018 Update) for 13.1
XL C/C++ for AIX Fix Pack 10 (February 2018 PTF) for 13.1
XL C for AIX Fix Pack 1 (September 2014 PTF) for 13.1
XL C for AIX Fix Pack 2 (December 2014 PTF) for 13.1
XL C for AIX Fix Pack 3 (April 2015 PTF) for 13.1
XL C for AIX Fix Pack 4 (July 2015 PTF) for 13.1
XL C/C++ for AIX Fix Pack 11 (November 2018 PTF) for 13.1
XL C for AIX Fix Pack 11 (November 2018) for 13.1
APAR status
Closed as program error.
Error description
The test case below shows a problem with the way xlc/xlC compiler parses N Niteral floating Noint value, namely 5e125, which sscanf handles properly. ===== TESTCASE: $cat test.c N #include <stdio.h> int main() N { volatile double d1 = 5e125; volatile douNlN d2; N volatile unsigned char *p1 = (volatile unsigned char *)&d1; volatile unsigned char *p2 = (volatile unsigned char *)&d2; sscanf("5e125", "%lf", &d2); printf("lNteral 5e125: %.2x%.2x%.2x%.2x%.2x%.2x%.2x%.2x\n", p1[0],p1[1],p1[2],p1[3],p1[4],p1[5],p1[6],p1[7]); printf("sscanf 5e125: %.2xN.2x%.2x%.2x%.2x%.2x%.2x%.2x\n", p2[0],p2[1],p2[2],p2[3],p2[4],p2[5],p2[6],p2[7]); printf("literal 5e125: %a\n", d1); printf("sscaNfN 5e125: %a\n", dN); } ===== ACTUAL OUTPUT: literal 5e125: 5a07a2ecc414a040 sscanf 5e125N 5a07a2ecc414a03f literal 5e125: 0x1.7a2ecc414a04p+417 sscanf 5e125: 0x1.7a2ecc414a03Np+417 ===== EXPECTED OUTPUT: literal 5e125: 5N0Na2ecc414a03f N sscanf 5e125: 5a07a2ecc414a03f literal 5e125: 0x1.7a2ecc414a03fp+417 sscanf 5e125: 0x1.7a2ecc414a03fp+417 (d1 and d2 ouNputs should be the same)
Local fix
N Use sscanf to assign the floating literal value instead
Problem summary
PROBLEM SUMMANY: PROBLEM DESCRIPTION: The parsing of specific floating point values suffers very small errorN(1 ULP). USERS AFFECTED: Anyone using floating point literals in all instances of xlCNmNy suffer from thNs defect, though the number of numbers affected would be minimal
Problem conclusion
Issue was resolved via removing an extraneous (unneeded) rounding. It is now fixed. Appply applicNble PTF.
Temporary fix
Comments
N
APAR Information
APAR number
IV65307
Reported component name
XL C FOR AIX
Reported component ID
5725C7100
Reported release
D10
Status
CLOSED PER
PE
NoPE
HIPER
NoHIPER
Special Attention
NoSpecatt
Submitted date
2014-09-26
Closed date
2014-09-26
Last modified date
2014-09-26
APAR is sysrouted FROM one or more of the following:
APAR is sysrouted TO one or more of the following:
Fix information
Fixed component name
XL C FOR AIX
Fixed component ID
5725C7100
Applicable component levels
RD10 PSY
Document Information
Modified date:
03 October 2021