-
Notifications
You must be signed in to change notification settings - Fork 240
8324307: [11u] hotspot fails to build with GCC 12 and newer (non-static data member initializers) #2470
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
…a member initializers)
👋 Welcome back jdowland! A progress list of the required criteria for merging this PR into |
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.
OK.
|
/approval request to fix building 11u-dev with GCC 12+. 11u-specific fix needed due to later JDKs moving to a newer C++ standards version. TIA! |
@jmtd, if these initializers are not needed at all, shouldn't they be removed in the higher releases as well? |
Removing the tag in the meantime |
Hi @GoeLin ,
This is a really good question and I took some time to ponder my reply. They are not needed from a computational POV because the relevant fields are all initialised in the object constructors in all cases. However, to know this I had to read through the class definition to be sure. I didn't write the original code but if I had I would have likely also preferred an explicit null initialisation in the member declaration, which makes clear the intent that we do not have uninitialised fields and do not risk reading from uninitialised fields. There's a chance the constructor could be altered later and an iniitialisation accidentally removed, or an alternative constructor added lacking the initialisation, etc. I doubt that anyone would welcome a patch to remove the redundant initialisers in main, but I could propose one if you disagree. WDYT? |
I would say this is the sort of change that belongs only in 11u and older, for compatibility reasons (old C/C++ standards, older compilers). The current code in 17u+ is fine with Incidentally, if we are fixing 11u to compile with GCC 12, should we not also enable a GHA build with GCC 12 in a separate PR so that it does not regress again? |
I'll re-label approval-request, a I doubt Goetz saw my comment (or yours @gnu-andrew ) /approval request rationale for change added in #2470 (comment) , please take another look!
Makes sense to me. I guess that would start with a new 11u-specific JDK bug; I'll file one. |
I think #2451 needs to be re-labelled as well. I'm not a fan of removing these requests outside the process used by the approval/approve commands as it isn't clear what's going on from the PR. |
@jmtd This change now passes all automated pre-integration checks. 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 39 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 |
/integrate |
Going to push as commit 1f516f6.
Your commit was automatically rebased without conflicts. |
GCC 12 and newer warn about non-static data member initialisers when operating under -std=gnu++98 (jdk11u-dev's C++ standards version). These warnings are promoted to errors by default.
This is an issue for jdk11u-dev which uses the C++ standard version '-std=gnu++98'. It is not an issue for later JDK versions which have moved to newer standards (JEP 347 moved JDK16 to -std=c++14): therefore an 11u-specific fix is required.
The approach used in this PR is to remove the initialisers, in common with what we did when backporting the same code to jdk8u-dev.
Progress
Issue
Reviewers
Reviewing
Using
git
Checkout this PR locally:
$ git fetch https://git.openjdk.org/jdk11u-dev.git pull/2470/head:pull/2470
$ git checkout pull/2470
Update a local copy of the PR:
$ git checkout pull/2470
$ git pull https://git.openjdk.org/jdk11u-dev.git pull/2470/head
Using Skara CLI tools
Checkout this PR locally:
$ git pr checkout 2470
View PR using the GUI difftool:
$ git pr show -t 2470
Using diff file
Download this PR as a diff file:
https://git.openjdk.org/jdk11u-dev/pull/2470.diff
Webrev
Link to Webrev Comment