-
Notifications
You must be signed in to change notification settings - Fork 6.2k
8319233: AArch64: Build failure with clang due to -Wformat-nonliteral warning #16486
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
… warning 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
|
👋 Welcome back haosun! A progress list of the required criteria for merging this PR into |
|
I think ppc and risc-v have the same issue. however, I don't have the corresponding hardware. I wonder if @TheRealMDoerr and @RealFYang could help verify:
|
|
PPC64 only supports clang on AIX. @jkern: Can you answer the 2 questions? |
|
Sorry, that was the wrong jkern. |
kimbarrett
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Shared changes look goo. Platform-specific changes also look good to me,
subject to verification by the respective platform maintainers. Happy to see
the elimination of the va_list dummy; stuff.
|
@shqking This change now passes all automated pre-integration checks. ℹ️ This project also has non-automated pre-integration requirements. Please see the file CONTRIBUTING.md for details. After integration, the commit message for the final commit will be: You can use pull request commands such as /summary, /contributor and /issue to adjust it as needed. At the time when this comment was updated there had been 4 new commits pushed to the
Please see this link for an up-to-date comparison between the source branch of this pull request and the ➡️ To integrate this PR with the above commit message to the |
|
During my switch to xlc17 I came across "error: format string is not a string literal" in several places. To fix this, I inserted lines like "DISABLED_WARNINGS_clang_aix_os_posix.cpp := format-nonliteral," in various places in the gmk files. So in principle we have the problem too, but the compiler didn't show up an error in os_aix_ppc.cpp or vmError.cpp. We will test your PR overnight in our test suite to check for regressions. |
eastig
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lgtm
|
We consumed your PR overnight. The AIX ppc64 based on clang was fine and without regressions. |
@shqking : Sorry, I don't have a clang for linux-riscv at hand. I guess @VladimirKempik might want to give it a try :-) |
|
I'll try |
|
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 has gone: |
|
Thanks a lot for your verification on ppc and risc-v. @JoKern65 and @VladimirKempik. Hence, I think this PR is ready to go. |
|
/integrate |
|
Going to push as commit 439ed04.
Your commit was automatically rebased without conflicts. |
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
Progress
Issue
Reviewers
Reviewing
Using
gitCheckout this PR locally:
$ git fetch https://git.openjdk.org/jdk.git pull/16486/head:pull/16486$ git checkout pull/16486Update a local copy of the PR:
$ git checkout pull/16486$ git pull https://git.openjdk.org/jdk.git pull/16486/headUsing Skara CLI tools
Checkout this PR locally:
$ git pr checkout 16486View PR using the GUI difftool:
$ git pr show -t 16486Using diff file
Download this PR as a diff file:
https://git.openjdk.org/jdk/pull/16486.diff
Webrev
Link to Webrev Comment