Fixes are available
XL C/C++ for AIX Fix Pack 11 (February 2015 PTF) for 12.1
XL C/C++ for AIX Fix Pack 12 (May 2015 PTF) for 12.1
XL C/C++ for AIX Fix Pack 13 (August 2015 Update) for 12.1
XL C/C++ for AIX Fix Pack 14 (December 2015 Update) for 12.1
XL C/C++ for AIX Fix Pack 15 (April 2016 Update) for 12.1
XL C/C++ for AIX Fix Pack 16 (July 2016 Update) for 12.1
XL C/C++ for AIX Fix Pack 17 (November 2016 Update) for 12.1
XL C/C++ for AIX Fix Pack 18 (February 2017 Update) for 12.1
XL C/C++ for AIX Fix Pack 19 (August 2017 Update) for 12.1
XL C/C++ for AIX Fix Pack 20 (March 2018 Update) for 12.1
XL C/C++ for AIX Fix Pack 9 (July 2014 PTF) for 12.1
XL C/C++ for AIX Fix Pack 10 (October 2014 PTF) for 12.1
XL C/C++ for AIX Fix Pack 21 (January 2019 Update) for 12.1
APAR status
Closed as program error.
Error description
Currently, when you specifiy an integer value to the floor() function, the compiler issues an error message as follows: ===== COMPILE COMMAND: bgxlC -c test.cpp ===== TESTCASE: $ cat test.cpp #include <stdio.h> #include <stdlib.h> #include <iostream> #include <cmath> using std::floor; int main(int argc, char *argv[]) { double d1, d2, d3; int i1, i2, i3; unsigned long ul1, ul2, ul3; d1 = 1.1; d2 = 2.9; i1=13; i2=5; ul1=737; ul2=47; //i3 = floor( d2 ); i3 = floor( i1 ); //i3 = floor( i1 / i2 ); //if ( floor( i3/i2 ) != floor( i2/i1 ) ) // d3=d2/d1; ul3 = floor( ul1 ); //ul3 = floor( ul1 / ul2 ); //if ( floor( ul3/ul2 ) != floor( ul2/ul1 ) ) // d1 = d3 * d2; return 0; } $ ===== ACTUAL OUTPUT: $ bgxlC test2.cpp -c "/bgsys/drivers/ppcfloor/gnu-linux/lib/gcc/powerpc64-bgq-linux/4 .4.7/../../../../powerpc64-bgq-linux/include/c++/4.4.7/cmath", line 269.14: 1540-0274 (S) The name lookup for "__builtin_floor" did not find a declaration. "/bgsys/drivers/ppcfloor/gnu-linux/lib/gcc/powerpc64-bgq-linux/4 .4.7/../../../../powerpc64-bgq-linux/include/c++/4.4.7/cmath", line 268.5: 1540-0700 (I) The previous message was produced while processing "std::floor<int>(int)". "test.cpp", line 22.9: 1540-0700 (I) The previous message was produced while processing "main(int, char *[])". "/bgsys/drivers/ppcfloor/gnu-linux/lib/gcc/powerpc64-bgq-linux/4 .4.7/../../../../powerpc64-bgq-linux/include/c++/4.4.7/cmath", line 269.14: 1540-0274 (S) The name lookup for "__builtin_floor" did not find a declaration. "/bgsys/drivers/ppcfloor/gnu-linux/lib/gcc/powerpc64-bgq-linux/4 .4.7/../../../../powerpc64-bgq-linux/include/c++/4.4.7/cmath", line 268.5: 1540-0700 (I) The previous message was produced while processing "std::floor<unsigned long>(unsigned long)". "test.cpp", line 29.10: 1540-0700 (I) The previous message was produced while processing "main(int, char *[])". $ ===== EXPECTED OUTPUT: Clean compile
Local fix
Cast the integer into a floating/double value.
Problem summary
USERS AFFECTED: Users who wish to pass in an integer parameter to floor() are affected by this issue. PROBLEM DESCRIPTION: The floor() function calls the internal __builtin_floor() which was not taking int as a parameter.
Problem conclusion
The internal __builtin_floor() function now has a forward declaration which accepts integers.
Temporary fix
Comments
APAR Information
APAR number
IV62684
Reported component name
XL C/C++ FOR AI
Reported component ID
5725C7200
Reported release
C10
Status
CLOSED PER
PE
NoPE
HIPER
NoHIPER
Special Attention
NoSpecatt / Xsystem
Submitted date
2014-07-18
Closed date
2014-07-18
Last modified date
2014-07-18
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/C++ FOR AI
Fixed component ID
5725C7200
Applicable component levels
RC10 PSN UP06/09/13
C
Document Information
Modified date:
21 August 2024