RFR: JDK-8308288: Fix xlc17 clang warnings in shared code [v2]

JoKern65 duke at openjdk.org
Fri May 26 10:20:58 UTC 2023


On Fri, 26 May 2023 08:31:46 GMT, JoKern65 <duke at openjdk.org> wrote:

>> When using the new xlc17 compiler (based on a recent clang) to build OpenJDk on AIX , we run into various "warnings as errors".
>> Some of those are in shared codebase and could be addressed by small adjustments.
>> A lot of those changes are in hotspot, some might be somewhere else in the OpenJDK C/C++ code.
>
> JoKern65 has updated the pull request incrementally with one additional commit since the last revision:
> 
>   forgotton _

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)) {
         ^

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) {
                   ~~~~~~~~~~~~~~~~~ ^

src/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);
                            ^~~

-------------

PR Comment: https://git.openjdk.org/jdk/pull/14146#issuecomment-1564165195


More information about the hotspot-dev mailing list