RFR: JDK-8355498 : [AIX] Adapt code for C++ VLA rule

Martin Doerr mdoerr at openjdk.org
Mon Apr 28 08:18:51 UTC 2025


On Thu, 24 Apr 2025 13:49:40 GMT, Suchismith Roy <sroy at openjdk.org> wrote:

> JBS Issue: [JDK-8355498](https://bugs.openjdk.org/browse/JDK-8355498)
> 
> 
> The declaration of Variable length array is causing compilation issues for Openxlc 17.1.3 compiler.
> 1 error generated.
> gmake[3]: *** [lib/CompileJvm.gmk:170: /home/jenkins/openjdk-suchi/jdk/build/aix-ppc64-server-fastdebug/hotspot/variant-server/libjvm/objs/os_perf_aix.o] Error 1
> gmake[2]: *** [make/Main.gmk:245: hotspot-server-libs] Error 2
> gmake[2]: *** Waiting for unfinished jobs....
> 
> ERROR: Build failed for target 'images' in configuration 'aix-ppc64-server-fastdebug' (exit code 2)
> Stopping javac server
> 
> === Output from failing command(s) repeated here ===
> * For target hotspot_variant-server_libjvm_objs_os_perf_aix.o:
> /home/jenkins/openjdk-suchi/jdk/src/hotspot/os/aix/os_perf_aix.cpp:79:12: error: variable length arrays in C++ are a Clang extension [-Werror,-Wvla-cxx-extension]
>    79 | char buf[BUF_LENGTH];
>       | ^~~~~~~~~~
> /home/jenkins/openjdk-suchi/jdk/src/hotspot/os/aix/os_perf_aix.cpp:79:12: note: read of non-const variable 'BUF_LENGTH' is not allowed in a constant expression
> /home/jenkins/openjdk-suchi/jdk/src/hotspot/os/aix/os_perf_aix.cpp:76:17: note: declared here
>    76 | static size_t BUF_LENGTH = 32 + sizeof(u_longlong_t);

LGTM.

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

Marked as reviewed by mdoerr (Reviewer).

PR Review: https://git.openjdk.org/jdk/pull/24851#pullrequestreview-2798411637


More information about the hotspot-runtime-dev mailing list