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

Suchismith Roy sroy at openjdk.org
Thu Apr 24 13:57:38 UTC 2025


JBS Issue: [JDK-8355498](https://bugs.openjdk.org/browse/JDK-8355498)


The declaration of Variable length array is causing compilation issues for 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);

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

Commit messages:
 - change static to const

Changes: https://git.openjdk.org/jdk/pull/24851/files
  Webrev: https://webrevs.openjdk.org/?repo=jdk&pr=24851&range=00
  Issue: https://bugs.openjdk.org/browse/JDK-8355498
  Stats: 1 line in 1 file changed: 0 ins; 0 del; 1 mod
  Patch: https://git.openjdk.org/jdk/pull/24851.diff
  Fetch: git fetch https://git.openjdk.org/jdk.git pull/24851/head:pull/24851

PR: https://git.openjdk.org/jdk/pull/24851


More information about the hotspot-runtime-dev mailing list