-
Notifications
You must be signed in to change notification settings - Fork 5.8k
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
8289049: x86_32 build fails with GCC 11 due to newString646_US warning #9702
Conversation
👋 Welcome back shade! A progress list of the required criteria for merging this PR into |
Webrevs
|
Any thoughts? |
@shipilev 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 28 new commits pushed to the
As there are no conflicts, your changes will automatically be rebased on top of these commits when integrating. If you prefer to avoid this automatic rebasing, please check the documentation for the /integrate command for further details. ➡️ To integrate this PR with the above commit message to the |
Thank you! Any other comments? I'll be integrating it soon otherwise. |
I'm confused. How does adding EnsureCapacity in newString646_US fix the compiler warning mentioned in JBS? |
I think this is a bona-fide compiler static analyzer bug. GCC 12 compiles this code fine. So, we have two options: a) disable the warnings for this code block; b) harmonize all code blocks to use the same style, which is also incidentally avoids the false warning. This PR does (b). |
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.
Looks good.
Okay, fair enough. |
Thanks! /integrate |
Going to push as commit 0c67fba.
Your commit was automatically rebased without conflicts. |
See bug report for reproducer and error message. The warning looks quite superficial, and I initially suspected that it complains about
int len = (int)strlen(str)
cast ofsize_t
. But what is confusing is nearly the similar code innewStringCp1252
apparently does not produce the warning:jdk/src/java.base/share/native/libjava/jni_util.c
Lines 533 to 566 in f5d1b5b
I propose we chalk it up to false/odd compiler warning and sync up unproblematic
newStringCp1252
andnewString646_US
implementation to dodge it.Additional testing:
tier1
test with GCC 9tier1
test with GCC 9Progress
Issue
Reviewers
Reviewing
Using
git
Checkout this PR locally:
$ git fetch https://git.openjdk.org/jdk pull/9702/head:pull/9702
$ git checkout pull/9702
Update a local copy of the PR:
$ git checkout pull/9702
$ git pull https://git.openjdk.org/jdk pull/9702/head
Using Skara CLI tools
Checkout this PR locally:
$ git pr checkout 9702
View PR using the GUI difftool:
$ git pr show -t 9702
Using diff file
Download this PR as a diff file:
https://git.openjdk.org/jdk/pull/9702.diff