RFR: JDK-8308288: Fix xlc17 clang warnings in shared code [v2]
Matthias Baesken
mbaesken at openjdk.org
Fri May 26 10:55:02 UTC 2023
On Fri, 26 May 2023 10:18:37 GMT, JoKern65 <duke at openjdk.org> wrote:
> Here are the reasons for the disabled warnings in make/modules/java.base/lib/CoreLibraries.gmk DISABLED_WARNINGS_clang_aix_ProcessHandleImpl_unix.c := sign-compare, DISABLED_WARNINGS_clang_aix := gnu-pointer-arith, DISABLED_WARNINGS_clang := gnu-pointer-arith format-nonliteral deprecated-non-prototype, \
>
> 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)) { ^
>
`fread` returns a `size_t ` on Linux and AIX, could you please check Mac/BSD too ?
https://github.com/openjdk/jdk/blob/d3b9b364da8c11c9b4dd14a6451a7b24f41202e7/src/java.base/unix/native/libjava/ProcessHandleImpl_unix.c#L636
We should probably change to size_t ret (from type int), then the warning would not occur, correct ?
-------------
PR Comment: https://git.openjdk.org/jdk/pull/14146#issuecomment-1564207011
More information about the core-libs-dev
mailing list