JDK-8309219: Fix xlc17 clang 15 warnings in java.base#14281
JDK-8309219: Fix xlc17 clang 15 warnings in java.base#14281JoKern65 wants to merge 3 commits intoopenjdk:masterfrom
Conversation
|
👋 Welcome back JoKern65! A progress list of the required criteria for merging this PR into |
GoeLin
left a comment
There was a problem hiding this comment.
Lib.gmk / DefaultProxySelector.c
Fixing this in the file would require a larger rework. Good.
Lib.gmk / NetworkInterface.c
This looks as if it could also be fixed in the code.
But previously, other warnings have not been fixed either.
So I'm fine with this.
CoreLibraries / deprecated-non-prototype
Fixes warning in zlib, we should not touch the code
there as it is from external. Good.
CoreLibraries / format-nonliteral
In hotspot, these warnings have been fixed, or
an attribute is used to disable them locally.
These places pop up in code scanners, too.
See compilerWarnings.hpp / ATTRIBUTE_PRINTF().
The code here can not be fixed, and
I don't see any usage of the attribute or similar
in java.base, so disabling the warning seems fine to me.
Also, it's treated similar in the other
compile block.
java_md_aix.c: good.
ProcessHandleImpl_unix.c: good
UnixNativeDispatcher.c: definitely an improvement to the code!
libGetXSpace.c: good. A test library
|
@JoKern65 This change now passes all automated pre-integration checks. ℹ️ This project also has non-automated pre-integration requirements. Please see the file CONTRIBUTING.md for details. After integration, the commit message for the final commit will be: You can use pull request commands such as /summary, /contributor and /issue to adjust it as needed. At the time when this comment was updated there had been 14 new commits pushed to the
As there are no conflicts, your changes will automatically be rebased on top of these commits when integrating. If you prefer to avoid this automatic rebasing, please check the documentation for the /integrate command for further details. As you do not have Committer status in this project an existing Committer must agree to sponsor your change. Possible candidates are the reviewers of this PR (@GoeLin, @TheRealMDoerr) but any other Committer may sponsor as well. ➡️ To flag this PR as ready for integration with the above commit message, type |
cast not necessary
|
/integrate |
|
/sponsor |
|
Going to push as commit 6eddbe2.
Your commit was automatically rebased without conflicts. |
|
@TheRealMDoerr @JoKern65 Pushed as commit 6eddbe2. 💡 You may see a message that your pull request was closed with unmerged commits. This can be safely ignored. |
This pr is a split off from JDK-8308288: Fix xlc17 clang warnings in shared code #14146
It handles the part in java.base.
Compiling on AIX with xlc17 which contains the new clang 15 frontend
shows the following warnings.
built by make/modules/java.base/Lib.gmk
src/java.base/unix/native/libnet/DefaultProxySelector.c:378:41:22: error: passing arguments to a function without a prototype is deprecated in all versions of C and is not supported in C2x [-Werror,-Wdeprecated-non-prototype]
proxies = (*g_proxy_resolver_lookup)(resolver, uri, NULL, &error);
^
src/java.base/unix/native/libnet/NetworkInterface.c:1612:24: error: arithmetic on a pointer to void is a GNU extension [-Werror,-Wgnu-pointer-arith]
end = (void *)nddp + size;
src/java.base/unix/native/libnio/fs/UnixNativeDispatcher.c:1251:7: error: '_ALLBSD_SOURCE' is not defined, evaluates to 0 [-Werror,-Wundef]
#elif _ALLBSD_SOURCE
The whole file checks whether _ALLBSD_SOURCE is defined, only where #elif is used the call to defined() was forgotten.
built by make/modules/java.base/lib/CoreLibraries.gmk
src/java.base/unix/native/libjava/ProcessHandleImpl_unix.c:638 comparison of integers of different signs: 'int' and 'unsigned long'
if (ret < sizeof(psinfo_t)) {
ProcessHandleImpl_unix.c: Just using the proper type
size_tinstead ofint.src/java.base/aix/native/libjli/java_md_aix.c:42:38: error: arithmetic on a pointer to void is a GNU extension [-Werror,-Wgnu-pointer-arith]
addr < p->ldinfo_textorg + p->ldinfo_textsize) {
we can fix this with temporary casting the
void*pointer tochar*or by disabling the warning in CoreLibraries.gmksrc/java.base/share/native/libzip/zlib/inffast.c:74:20: error: a function definition without a prototype is deprecated in all versions of C and is not supported in C2x [-Werror,-Wdeprecated-non-prototype]
void ZLIB_INTERNAL inflate_fast(strm, start)
^
src/java.base/share/native/libjli/java.c:2311:22: error: format string is not a string literal [-Werror,-Wformat-nonliteral]
vfprintf(stderr, fmt, vl);
^~~
The test library libGetXSpace.c also shows a warning.
In addition, the cast in that lib is wrong, we opened "JDK-8309216 cast from jchar* to char* in test GetXSpace.java" for that.
Progress
Issue
"4")Reviewers
Reviewing
Using
gitCheckout this PR locally:
$ git fetch https://git.openjdk.org/jdk.git pull/14281/head:pull/14281$ git checkout pull/14281Update a local copy of the PR:
$ git checkout pull/14281$ git pull https://git.openjdk.org/jdk.git pull/14281/headUsing Skara CLI tools
Checkout this PR locally:
$ git pr checkout 14281View PR using the GUI difftool:
$ git pr show -t 14281Using diff file
Download this PR as a diff file:
https://git.openjdk.org/jdk/pull/14281.diff
Webrev
Link to Webrev Comment