Skip to content

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

Open
fthevenet wants to merge 1 commit into
openjdk:masterfrom
fthevenet:backport-16971af1
Open

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

Conversation

@fthevenet

@fthevenet fthevenet commented Jun 26, 2026

Copy link
Copy Markdown
Member

This is an unclean backport of of commit 16971af1 from the openjdk/jdk17u-dev 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 patch does not appy cleanly; the following modifications were necessary:

  • Ignore the changes to src/jdk.jpackage/linux/native/applauncher/LinuxPackage.c as the file doesn't exists in jdk11
  • The changes in src/java.base/unix/native/libnet/NetworkInterface.c are not applicaple to jdk11 (*colonP is assigned a value at line 251, cannot be declared const)
  • A change not included in the original patch is required to prevent a discarded-qualifiers warning in src/jdk.jdwp.agent/share/native/libdt_socket/socketTransport.c

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



Progress

  • Change must be properly reviewed (1 review required, with at least 1 Reviewer)
  • 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)

Reviewing

Using git

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

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

Using Skara CLI tools

Checkout this PR locally:
$ git pr checkout 3231

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

Using diff file

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

Using Webrev

Link to Webrev Comment

@fthevenet fthevenet marked this pull request as draft June 26, 2026 15:18
@bridgekeeper

bridgekeeper Bot commented Jun 26, 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 26, 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 16971af10713a9ddd142532845ac58649cf2f970 8378180: Compiling OpenJDK with C23 C-Compiler gives warning: initialization discards ‘const’ qualifier from pointer target type Jun 26, 2026
@openjdk

openjdk Bot commented Jun 26, 2026

Copy link
Copy Markdown

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

@openjdk openjdk Bot added the backport Port of a pull request already in a different code base label Jun 26, 2026
@fthevenet fthevenet marked this pull request as ready for review June 26, 2026 16:29
@openjdk openjdk Bot added the rfr Pull request is ready for review label Jun 26, 2026
@mlbridge

mlbridge Bot commented Jun 26, 2026

Copy link
Copy Markdown

Webrevs

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

backport Port of a pull request already in a different code base rfr Pull request is ready for review

Development

Successfully merging this pull request may close these issues.

1 participant