Fixes are available
January 2009 PTF for XL C/C++ Enterprise Edition for AIX, V9.0
April 2009 PTF for XL C/C++ Enterprise Edition for AIX, V9.0
July 2009 PTF for XL C/C++ Enterprise Edition for AIX, V9.0
November 2010 PTF for XL C/C++ Enterprise Edition for AIX, V9.0
March 2011 PTF for XL C/C++ Enterprise Edition for AIX, V9.0
July 2011 PTF for XL C/C++ Enterprise Edition for AIX, V9.0
December 2011 PTF for XL C/C++ Enterprise Edition for AIX, V9.0
March 2012 PTF for XL C/C++ Enterprise Edition for AIX, V9.0
January 2010 PTF for XL C/C++ Enterprise Edition for AIX, V9.0
May 2010 PTF for XL C/C++ Enterprise Edition for AIX, V9.0
August 2010 PTF for XL C/C++ Enterprise Edition for AIX, V9.0
APAR status
Closed as program error.
Error description
The following error is received when compiling this testcase: "1540-2638 (S) The __thread keyword can only be specified for external or static data." ______________________________________________________________ ______________________________________________________________ ______________________________________________________________ #include <omp.h> class A { public: static __thread int localInt; }; __thread int A::localInt; int main () { A::localInt = 10; printf( "Static's value: %d\n", A::localInt ); return 0; }
Local fix
Use namespace scoped thread static variables instead of member thread static variables. ______________________________________________________________ ______________________________________________________________ For example: namespace A { static __thread int localInt; }; Instead of: class A { public: static __thread int localInt; }; __thread int A::localInt;
Problem summary
thread static local and thread static data member variables. Invalid error diagnostic emitted by compiler.
Problem conclusion
The invalid diagnostics have been corrected and correct functionality confirmed.
Temporary fix
Comments
APAR Information
APAR number
IZ40798
Reported component name
XLC C++ AIX
Reported component ID
5724S7100
Reported release
900
Status
CLOSED PER
PE
NoPE
HIPER
NoHIPER
Special Attention
NoSpecatt
Submitted date
2009-01-02
Closed date
2012-05-09
Last modified date
2012-05-09
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
XLC C++ AIX
Fixed component ID
5724S7100
Applicable component levels
R900 PSY
UP
Document Information
Modified date:
04 October 2021