-
Notifications
You must be signed in to change notification settings - Fork 252
8224087: Compile C code for at least C99 Standard compliance #3087
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
|
👋 Welcome back zzambers! A progress list of the required criteria for merging this PR into |
|
@zzambers 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 4 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. As you do not have Committer status in this project an existing Committer must agree to sponsor your change. Possible candidates are the reviewers of this PR (@gnu-andrew) but any other Committer may sponsor as well. ➡️ To flag this PR as ready for integration with the above commit message, type |
|
This backport pull request has now been updated with issue from the original commit. |
gnu-andrew
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.
I'm in two minds about this. Specifying the standard explicitly is the right thing to do (I added similar for C++ years back) but we could just make that C90 so as to not raise older compilers.
I think, given some compilers have been defaulting to C99 for some time anyway (and maybe even later), this should be safe and may avoid problems with future backports. Let's get it in early and ensure it is well tested before January.
What compilers have you tested this change with?
|
I was also thinking, whether c99 is ok here, but given that jdk13 has same minimum compiler versions, it should be safe. Apart from testing in GHA. I tested these compiler versions (WORK):
Minimum accepted versions are gcc-4.8 and clang 3.2, so I tried to get close to that, based on what is available in old rhel/debian, not building my own toolchain. (Debian Jessie has clang 3.5, but that one (clang) was segfaulting during the build even on master, and Wheezy has clang 3.0) For msvc there should be no change in compiler flags by this backport. When it comes to Solaris, I could not test build there, because I don't have that OS available to me. But given that some awt libraries were already compiled with c99 flags, compiler flags should work. |
|
Build logs: |
gnu-andrew
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.
Thanks. My main concern was less what is claimed to be supported and more what people are actively building on at present. In particular, I'm reassured that it still builds on RHEL 7 as that's the one of most importance to us and where I test each build promotion.
I think the Solaris change, while untested, should be safe as it essentially just widens the scope of the existing usage from awt to the whole library build. My concern was the new option.
I think this is good to go in and should then get plenty of testing before January's release.
|
/approve yes |
|
@gnu-andrew |
|
Confirmed this builds on |
|
/integrate |
|
/sponsor |
|
Going to push as commit 156d998.
Your commit was automatically rebased without conflicts. |
This backport explicitly sets c99 standard for jdk c sources on compilers, where appropriate. Motivation for this is, recent gcc switch to c23 as default, causing errors (jdk sources are not c23 compatible).
Main problem is, that c23 no longer supports non-prototype function declarations (see (3) here). Example errors:
There are more, if above are fixed. Non prototype function declarations are present even in newest jdk, but newer jdks have c standard set explicitly, so they do not cause errors there.
This should not increase minimum requirements for compiler toolchains needed to build jdk11. Jdk13, where this originates from, has same minimal compiler requirements as jdk11. ( gcc 4.8, clang 3.2, Xcode 8, Solaris Studio 12.4)
Progress
Issue
Reviewers
Reviewing
Using
gitCheckout this PR locally:
$ git fetch https://git.openjdk.org/jdk11u-dev.git pull/3087/head:pull/3087$ git checkout pull/3087Update a local copy of the PR:
$ git checkout pull/3087$ git pull https://git.openjdk.org/jdk11u-dev.git pull/3087/headUsing Skara CLI tools
Checkout this PR locally:
$ git pr checkout 3087View PR using the GUI difftool:
$ git pr show -t 3087Using diff file
Download this PR as a diff file:
https://git.openjdk.org/jdk11u-dev/pull/3087.diff
Using Webrev
Link to Webrev Comment