Skip to content

Commit 4962507

Browse files
committed
Explicit header definitions for Open XL warnings
Open XL 2.1 on z/OS reports some of the implicit declarations as errors, and requires these to be explicitly defined. Most of the underlying changes are to address this concern and some other fixes pertaining to compilation errors. zos.cmake now uses _XOPEN_SOURCE=600, which implies/includes already namespaces from _POSIX_SOURCE, _XOPEN_SOURCE_THREADED, _ISOC99_SOURCE. See feature test macros: https://www.ibm.com/docs/en/zos/3.1.0?topic=files-feature-test-macros timer.h - unneeded conditional removed Array.hpp - uninitialized variable addressed Signed-off-by: Gaurav Chaudhari <[email protected]>
1 parent 6c150bb commit 4962507

File tree

17 files changed

+43
-31
lines changed

17 files changed

+43
-31
lines changed

cmake/modules/platform/os/zos.cmake

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -21,17 +21,21 @@
2121

2222
list(APPEND OMR_PLATFORM_DEFINITIONS
2323
-D_ALL_SOURCE
24+
-DJ9ZOS390
25+
-DLONGLONG
2426
-D_OPEN_THREADS=3
25-
-D_POSIX_SOURCE
26-
-D_XOPEN_SOURCE_EXTENDED
27-
-D_ISOC99_SOURCE
2827
-D__STDC_LIMIT_MACROS
29-
-DLONGLONG
30-
-DJ9ZOS390
3128
-DSUPPORTS_THREAD_LOCAL
29+
-D_XOPEN_SOURCE=600
3230
-DZOS
3331
)
3432

33+
if(OMR_ENV_DATA64)
34+
list(APPEND OMR_PLATFORM_DEFINITIONS
35+
-DJ9ZOS39064
36+
)
37+
endif()
38+
3539
# CMake ignores any include directories which appear in IMPLICIT_INCLUDE_DIRECTORIES.
3640
# This causes an issue with a2e since we need to re-specify them after clearing default search path.
3741
list(REMOVE_ITEM CMAKE_C_IMPLICIT_INCLUDE_DIRECTORIES /usr/include)

cmake/modules/platform/toolcfg/xlc.cmake

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -166,10 +166,6 @@ elseif(OMR_OS_ZOS)
166166
)
167167

168168
if(OMR_ENV_DATA64)
169-
list(APPEND OMR_PLATFORM_DEFINITIONS
170-
-DJ9ZOS39064
171-
)
172-
173169
list(APPEND OMR_PLATFORM_COMPILE_OPTIONS
174170
-Wc,lp64
175171
"\"-Wa,SYSPARM(BIT64)\""

compiler/cs2/timer.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ class AIXTimer {
8181
};
8282

8383
typedef AIXTimer PlatformTimer;
84-
#elif defined(LINUX) || defined(OSX) || (defined (__MVS__) && defined (_XOPEN_SOURCE_EXTENDED))
84+
#elif defined(LINUX) || defined(OSX) || defined(__MVS__)
8585
/**
8686
* \brief Linux-specific timer class.
8787
*

compiler/infra/Array.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -227,7 +227,7 @@ template<class T> class TR_Array
227227
uint32_t prevSize = _nextIndex * sizeof(T);
228228
uint32_t newSize = size * sizeof(T);
229229

230-
char * tmpArray;
230+
char * tmpArray = NULL;
231231
if (_trMemory)
232232
tmpArray = (char*)_trMemory->allocateMemory(newSize, _allocationKind, TR_MemoryBase::Array);
233233
else if (_trPersistentMemory)

include_core/unix/thrdsup.h

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -89,6 +89,12 @@ int linux_pthread_cond_timedwait(pthread_cond_t *cond, pthread_mutex_t *mutex, c
8989
intptr_t init_thread_library(void);
9090
intptr_t set_pthread_priority(pthread_t handle, omrthread_prio_t j9ThreadPriority);
9191
intptr_t set_pthread_name(pthread_t self, pthread_t thread, const char *name);
92+
intptr_t sem_init_zos(j9sem_t s, int pShared, int initValue);
93+
intptr_t sem_destroy_zos(j9sem_t s);
94+
intptr_t sem_getvalue_zos(j9sem_t s);
95+
intptr_t sem_trywait_zos(j9sem_t s);
96+
intptr_t sem_wait_zos(j9sem_t s);
97+
intptr_t sem_post_zos(j9sem_t s);
9298

9399
extern struct J9ThreadLibrary default_library;
94100

port/zos390/omrcel4ro31.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -124,7 +124,7 @@ omr_cel4ro31_call(OMR_CEL4RO31_infoBlock *infoBlock);
124124
* @return whether CEL4RO31 runtime support is available.
125125
*/
126126
BOOLEAN
127-
omr_cel4ro31_isSupported(void);
127+
omr_cel4ro31_is_supported(void);
128128

129129
/**
130130
* A helper routine to return an error message associated with the CEL4RO31 return code.

port/zos390/omrgetjobid.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@
2323
#include <stdlib.h>
2424
#include "omrport.h"
2525
#include "omrgetjobid.h"
26+
#include "omrportpriv.h"
2627

2728
#define JOBID_STRING_LENGTH 9
2829

port/zos390/omrgetjobname.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,7 @@ void
4848
omrget_jobname(struct OMRPortLibrary *portLibrary, char *jobname, uintptr_t length)
4949
{
5050
char *tmp_jobname = (char *)__malloc31(J9_MAX_JOBNAME);
51+
extern void _JOBNAME(char *); /* defined in omrjobname.s */
5152

5253
if (NULL != tmp_jobname) {
5354
char *ascname = NULL;

port/zos390/omrgetsysname.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@
2121
*******************************************************************************/
2222

2323
#include <stdlib.h>
24+
#include <string.h>
2425
#include <sys/utsname.h>
2526
#include "omrgetsysname.h"
2627

port/zos390/omrgetuserid.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,7 @@ omrget_userid(char *userid, uintptr_t length)
5454
uintptr_t result = 0;
5555

5656
userid[0] = '\0';
57+
extern void _USERID(char *); /* defined in omruserid.s */
5758

5859
if (NULL != tmp_userid) {
5960
char *ascname = NULL;

0 commit comments

Comments
 (0)