RFR: 8319233: AArch64: Build failure with clang due to -Wformat-nonliteral warning

Hao Sun haosun at openjdk.org
Fri Nov 3 02:57:28 UTC 2023


The root cause is that an incorrect variant of function VMError::report_and_die() is used. We should introduce another variadic function, just as macos_aarch64 did before.

GCC toolchain:
>From [1][2], GCC differs from Clang in flag -Wformat-nonliteral slightly, i.e. GCC may **not** raise a warning if "the format function takes its fromat arguments as a va_list". That's why this issue is not exposed by GCC toolchain before.

Besides, I suppose platforms ppc and risc-v may have the same issue.

[1] https://gcc.gnu.org/onlinedocs/gcc-11.4.0/gcc/Warning-Options.html
[2] https://releases.llvm.org/14.0.0/tools/clang/docs/DiagnosticsReference.html

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

Commit messages:
 - 8319233: AArch64: Build failure with clang due to -Wformat-nonliteral warning

Changes: https://git.openjdk.org/jdk/pull/16486/files
 Webrev: https://webrevs.openjdk.org/?repo=jdk&pr=16486&range=00
  Issue: https://bugs.openjdk.org/browse/JDK-8319233
  Stats: 35 lines in 7 files changed: 13 ins; 17 del; 5 mod
  Patch: https://git.openjdk.org/jdk/pull/16486.diff
  Fetch: git fetch https://git.openjdk.org/jdk.git pull/16486/head:pull/16486

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


More information about the hotspot-dev mailing list