Skip to content

8378180: Compiling OpenJDK with C23 C-Compiler gives warning: initialization discards ‘const’ qualifier from pointer target type#4522

Open
fthevenet wants to merge 1 commit into
openjdk:masterfrom
fthevenet:backport-548d07d
Open

8378180: Compiling OpenJDK with C23 C-Compiler gives warning: initialization discards ‘const’ qualifier from pointer target type#4522
fthevenet wants to merge 1 commit into
openjdk:masterfrom
fthevenet:backport-548d07d

Conversation

@fthevenet

@fthevenet fthevenet commented Jun 17, 2026

Copy link
Copy Markdown
Member

This is an unclean backport of of commit 548d07d3 from the openjdk/jdk repository (itslef a backport of 76a44b3e from openjdk/jdk).

The aim for this backport is to address compiler warnings that arise when attempting to build with with more recent version of gcc (16.1+).

The backport does not apply cleanly, because I had to omit the clean-up of an used variable in log_messages.c that was introduced in jdk 20 as part of JDK-8289768.
I opted to not do a prior backport for JDK-8289768, as it touches quite a large number of files.

I have verified that with this patch, jdk17u-dev compiles without warning on Fedora 44 with gcc 16.1.1.



Progress

  • Change must not contain extraneous whitespace
  • Commit message must refer to an issue
  • JDK-8378180 needs maintainer approval

Issue

  • JDK-8378180: Compiling OpenJDK with C23 C-Compiler gives warning: initialization discards ‘const’ qualifier from pointer target type (Enhancement - P3 - Requested)

Reviewing

Using git

Checkout this PR locally:
$ git fetch https://git.openjdk.org/jdk17u-dev.git pull/4522/head:pull/4522
$ git checkout pull/4522

Update a local copy of the PR:
$ git checkout pull/4522
$ git pull https://git.openjdk.org/jdk17u-dev.git pull/4522/head

Using Skara CLI tools

Checkout this PR locally:
$ git pr checkout 4522

View PR using the GUI difftool:
$ git pr show -t 4522

Using diff file

Download this PR as a diff file:
https://git.openjdk.org/jdk17u-dev/pull/4522.diff

Using Webrev

Link to Webrev Comment

@bridgekeeper

bridgekeeper Bot commented Jun 17, 2026

Copy link
Copy Markdown

👋 Welcome back fthevenet! A progress list of the required criteria for merging this PR into master will be added to the body of your pull request. There are additional pull request commands available for use with this pull request.

@openjdk

openjdk Bot commented Jun 17, 2026

Copy link
Copy Markdown

❗ This change is not yet ready to be integrated.
See the Progress checklist in the description for automated requirements.

@openjdk openjdk Bot changed the title backport 548d07d313ba16e6d99cfdfcc37165be89c242dc 8378180: Compiling OpenJDK with C23 C-Compiler gives warning: initialization discards ‘const’ qualifier from pointer target type Jun 17, 2026
@openjdk

openjdk Bot commented Jun 17, 2026

Copy link
Copy Markdown

This backport pull request has now been updated with issue from the original commit.

@openjdk openjdk Bot added backport Port of a pull request already in a different code base clean Identical backport; no merge resolution required labels Jun 17, 2026
@fthevenet fthevenet marked this pull request as ready for review June 17, 2026 11:29
@openjdk

openjdk Bot commented Jun 17, 2026

Copy link
Copy Markdown

⚠️ @fthevenet This change is now ready for you to apply for maintainer approval. This can be done directly in each associated issue or by using the /approval command.

@openjdk openjdk Bot added the rfr Pull request is ready for review label Jun 17, 2026
@mlbridge

mlbridge Bot commented Jun 17, 2026

Copy link
Copy Markdown

Webrevs

@fthevenet

Copy link
Copy Markdown
Member Author

/approval request I'd like to backport this to JDK 17.

Motivation: This patch is needed in order to build jdk17u with more recent version of gcc (16.1.1+), as it fixes compiler warnings.
The backport does not apply cleanly, because I had to omit the clean-up of an used variable in log_messages.c that was introduced in jdk 20 as part of JDK-8289768.
I opted to not do a prior backport for JDK-8289768, as it touches quite a large number of files.

The change introduces no behaviour change and is low risk.

I have verified that with this patch, jdk17u-dev compiles without warning on Fedora 44 with gcc 16.1.1.

@openjdk

openjdk Bot commented Jun 18, 2026

Copy link
Copy Markdown

@fthevenet
8378180: The approval request has been created successfully.

@openjdk openjdk Bot added the approval Requires approval; will be removed when approval is received label Jun 18, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

approval Requires approval; will be removed when approval is received backport Port of a pull request already in a different code base clean Identical backport; no merge resolution required rfr Pull request is ready for review

Development

Successfully merging this pull request may close these issues.

1 participant