RFR: 8319233: AArch64: Build failure with clang due to -Wformat-nonliteral warning
Vladimir Kempik
vkempik at openjdk.org
Sat Nov 4 15:50:07 UTC 2023
On Fri, 3 Nov 2023 02:50:22 GMT, Hao Sun <haosun at openjdk.org> wrote:
> 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
looks better on risc-v now, we still have issues with register storage specifier is deprecated and incompatible with c++17 for vm_version_linux_riscv.cpp line 77. but it's unrelated to this PR.
This issue have gone:
os_linux_riscv.cpp:255:62: error: format string is not a string literal [-Werror,-Wformat-nonliteral]
255 | VMError::report_and_die(thread, uc, nullptr, 0, msg, detail_msg, va_dummy);
| ^~~~~~~~~~
os_linux_riscv.cpp:255:74: error: variable 'va_dummy' is uninitialized when used here [-Werror,-Wuninitialized]
255 | VMError::report_and_die(thread, uc, nullptr, 0, msg, detail_msg, va_dummy);
-------------
PR Comment: https://git.openjdk.org/jdk/pull/16486#issuecomment-1793480523
More information about the hotspot-dev
mailing list