User compiling with the OS390 2.10 compiler started to receive syntax errors in pthread.h.
The following error messages were received during the compile.
"CEE.SCEEH.H(PTHREAD)", line 242.53: CBC1090(S) Syntax error - expected "expression" and found ")". "CEE.SCEEH.H(PTHREAD)", line 243.60: CBC1090(S) Syntax error - expected "expression" and found ")".
"CEE.SCEEH.H(PTHREAD)", line 248.31: CBC1013(S) Identifier "pthread_t" is undefined. .... etc.
In Addition: Using z/OS C/C++ Compile a CCN5827 error was reported in limits.h when system header files were included prior to define for _OPEN_THREADS
The cause of the problem was the location of the define for _OPEN_THREADS needed for pthread. Its #define must be first.
Resolving the problem
Move the #define _OPEN_THREADS to the top of the source program or use the compiler option DEF(_OPEN_THREADS). Defines such as these are best placed ahead of any include files used by the application. Note that a similar problem may be seen on releases of the compiler after OS390 2.10.0.
This rule is documented in the C/C++ Runtime Library Reference. It has a section on using Feature Test Macros and mentions using defines prior to including any header files.
|Software Development||OS/390 C/C++||z/OS||2.10|
Rate this page:
Copyright and trademark information
IBM, the IBM logo and ibm.com are trademarks of International Business Machines Corp., registered in many jurisdictions worldwide. Other product and service names might be trademarks of IBM or other companies. A current list of IBM trademarks is available on the Web at "Copyright and trademark information" at www.ibm.com/legal/copytrade.shtml.