Skip to content

Commit 6eddbe2

Browse files
JoKern65TheRealMDoerr
authored andcommitted
8309219: Fix xlc17 clang 15 warnings in java.base
Reviewed-by: goetz, mdoerr
1 parent 177e832 commit 6eddbe2

File tree

6 files changed

+12
-9
lines changed

6 files changed

+12
-9
lines changed

make/modules/java.base/Lib.gmk

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,8 @@ $(eval $(call SetupJdkLibrary, BUILD_LIBNET, \
4646
DISABLED_WARNINGS_gcc_net_util_md.c := format-nonliteral, \
4747
DISABLED_WARNINGS_gcc_NetworkInterface.c := unused-function, \
4848
DISABLED_WARNINGS_clang_net_util_md.c := format-nonliteral, \
49+
DISABLED_WARNINGS_clang_aix_DefaultProxySelector.c := deprecated-non-prototype, \
50+
DISABLED_WARNINGS_clang_aix_NetworkInterface.c := gnu-pointer-arith, \
4951
DISABLED_WARNINGS_microsoft_InetAddress.c := 4244, \
5052
DISABLED_WARNINGS_microsoft_ResolverConfigurationImpl.c := 4996, \
5153
LDFLAGS := $(LDFLAGS_JDKLIB) \

make/modules/java.base/lib/CoreLibraries.gmk

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -198,6 +198,7 @@ ifeq ($(call isTargetOs, aix), true)
198198
OPTIMIZATION := HIGH, \
199199
CFLAGS := $(STATIC_LIBRARY_FLAGS) $(CFLAGS_JDKLIB) $(LIBJLI_CFLAGS) \
200200
$(addprefix -I, $(LIBJLI_SRC_DIRS)), \
201+
DISABLED_WARNINGS_clang_aix := format-nonliteral deprecated-non-prototype, \
201202
ARFLAGS := $(ARFLAGS), \
202203
OBJECT_DIR := $(SUPPORT_OUTPUTDIR)/native/$(MODULE)/libjli_static))
203204

src/java.base/aix/native/libjli/java_md_aix.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ static int dladdr_dont_reload(void *addr, Dl_info *info) {
3939
memset((void *)info, 0, sizeof(Dl_info));
4040
for (;;) {
4141
if (addr >= p->ldinfo_textorg &&
42-
addr < p->ldinfo_textorg + p->ldinfo_textsize) {
42+
(char*)addr < (char*)(p->ldinfo_textorg) + p->ldinfo_textsize) {
4343
info->dli_fname = p->ldinfo_filename;
4444
return 1;
4545
}

src/java.base/unix/native/libjava/ProcessHandleImpl_unix.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2014, 2022, Oracle and/or its affiliates. All rights reserved.
2+
* Copyright (c) 2014, 2023, Oracle and/or its affiliates. All rights reserved.
33
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
44
*
55
* This code is free software; you can redistribute it and/or modify it
@@ -622,7 +622,7 @@ jint unix_getChildren(JNIEnv *env, jlong jpid, jlongArray jarray,
622622
static int getPsinfo(pid_t pid, psinfo_t *psinfo) {
623623
FILE* fp;
624624
char fn[32];
625-
int ret;
625+
size_t ret;
626626

627627
/*
628628
* Try to open /proc/%d/psinfo

src/java.base/unix/native/libnio/fs/UnixNativeDispatcher.c

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2008, 2022, Oracle and/or its affiliates. All rights reserved.
2+
* Copyright (c) 2008, 2023, Oracle and/or its affiliates. All rights reserved.
33
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
44
*
55
* This code is free software; you can redistribute it and/or modify it
@@ -1248,7 +1248,7 @@ Java_sun_nio_fs_UnixNativeDispatcher_fgetxattr0(JNIEnv* env, jclass clazz,
12481248

12491249
#ifdef __linux__
12501250
res = fgetxattr(fd, name, value, valueLen);
1251-
#elif _ALLBSD_SOURCE
1251+
#elif defined(_ALLBSD_SOURCE)
12521252
res = fgetxattr(fd, name, value, valueLen, 0, 0);
12531253
#else
12541254
throwUnixException(env, ENOTSUP);
@@ -1269,7 +1269,7 @@ Java_sun_nio_fs_UnixNativeDispatcher_fsetxattr0(JNIEnv* env, jclass clazz,
12691269

12701270
#ifdef __linux__
12711271
res = fsetxattr(fd, name, value, valueLen, 0);
1272-
#elif _ALLBSD_SOURCE
1272+
#elif defined(_ALLBSD_SOURCE)
12731273
res = fsetxattr(fd, name, value, valueLen, 0, 0);
12741274
#else
12751275
throwUnixException(env, ENOTSUP);
@@ -1288,7 +1288,7 @@ Java_sun_nio_fs_UnixNativeDispatcher_fremovexattr0(JNIEnv* env, jclass clazz,
12881288

12891289
#ifdef __linux__
12901290
res = fremovexattr(fd, name);
1291-
#elif _ALLBSD_SOURCE
1291+
#elif defined(_ALLBSD_SOURCE)
12921292
res = fremovexattr(fd, name, 0);
12931293
#else
12941294
throwUnixException(env, ENOTSUP);
@@ -1307,7 +1307,7 @@ Java_sun_nio_fs_UnixNativeDispatcher_flistxattr(JNIEnv* env, jclass clazz,
13071307

13081308
#ifdef __linux__
13091309
res = flistxattr(fd, list, (size_t)size);
1310-
#elif _ALLBSD_SOURCE
1310+
#elif defined(_ALLBSD_SOURCE)
13111311
res = flistxattr(fd, list, (size_t)size, 0);
13121312
#else
13131313
throwUnixException(env, ENOTSUP);

test/jdk/java/io/File/libGetXSpace.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -143,7 +143,7 @@ Java_GetXSpace_getSpace0
143143
(*env)->ReleaseStringChars(env, root, strchars);
144144

145145
struct statfs buf;
146-
int result = statfs((const char*)chars, &buf);
146+
int result = statfs(chars, &buf);
147147
free(chars);
148148
if (result < 0) {
149149
JNU_ThrowByNameWithLastError(env, "java/lang/RuntimeException",

0 commit comments

Comments
 (0)