Skip to content

Conversation

@sendaoYan
Copy link
Member

@sendaoYan sendaoYan commented Jan 14, 2025

Hi all,
This PR fix build failure by clang17 after JDK-8313396. Before this PR file src/hotspot/share/utilities/forbiddenFunctions.hpp #include <stdlib.h> and then #include "forbiddenFunctions_posix.hpp". System header file <stdlib.h> define realpath function, and file forbiddenFunctions_posix.hpp add attribute declaration for realpath function, so clang17 report compile warning "attribute declaration must precede definition". This PR switch the sequence of #include <stdlib.h> and #include "forbiddenFunctions_posix.hpp" in file src/hotspot/share/utilities/forbiddenFunctions.hpp to fix this compile warning issue.

Below code snippet shows the clang17 compile waning:

void a(const char *, char *){};
[[deprecated]] void a(const char *, char *);
clang -Wall -c ~/compiler-test/zzkk/attribute.cpp
/home/yansendao/compiler-test/zzkk/attribute.cpp:5:3: warning: attribute declaration must precede definition [-Wignored-attributes]
    5 | [[deprecated]] void a(const char *, char *);
      |   ^
/home/yansendao/compiler-test/zzkk/attribute.cpp:4:6: note: previous definition is here
    4 | void a(const char *, char *){};
      |      ^
1 warning generated.

Additional testing:

  • configure and make with gcc10 with release/fastdebug debug level
  • configure and make with gcc14 with release/fastdebug debug level

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

Issue

  • JDK-8347649: Build fails by clang17 after JDK-8313396 (Bug - P3)

Reviewing

Using git

Checkout this PR locally:
$ git fetch https://git.openjdk.org/jdk.git pull/23102/head:pull/23102
$ git checkout pull/23102

Update a local copy of the PR:
$ git checkout pull/23102
$ git pull https://git.openjdk.org/jdk.git pull/23102/head

Using Skara CLI tools

Checkout this PR locally:
$ git pr checkout 23102

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

Using diff file

Download this PR as a diff file:
https://git.openjdk.org/jdk/pull/23102.diff

Using Webrev

Link to Webrev Comment

@bridgekeeper
Copy link

bridgekeeper bot commented Jan 14, 2025

👋 Welcome back syan! 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
Copy link

openjdk bot commented Jan 14, 2025

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

@openjdk openjdk bot added the rfr Pull request is ready for review label Jan 14, 2025
@openjdk
Copy link

openjdk bot commented Jan 14, 2025

@sendaoYan The following label will be automatically applied to this pull request:

  • hotspot

When this pull request is ready to be reviewed, an "RFR" email will be sent to the corresponding mailing list. If you would like to change these labels, use the /label pull request command.

@openjdk openjdk bot added the hotspot hotspot-dev@openjdk.org label Jan 14, 2025
@mlbridge
Copy link

mlbridge bot commented Jan 14, 2025

Webrevs

@TheShermanTanker
Copy link
Contributor

I'm not sure this would work, the includes from the system are placed in front of the forbiddenFunctions includes so that the declaration from the system headers are seen first, which I think is needed for the workaround for clang. Pinging @kimbarrett for this

@kimbarrett
Copy link

I'm not sure this would work, the includes from the system are placed in front of the forbiddenFunctions includes so that the declaration from the system headers are seen first, which I think is needed for the workaround for clang. Pinging @kimbarrett for this

Yes, I've seen this PR. No, don't do this yet. I need to look into this in more detail. I already have a reason to possibly
backout JDK-8313396, because of an Oracle-internal issue. This argues I'm probably really going to have to do that.

@dholmes-ora
Copy link
Member

The backout was done, so this PR and issue can be closed. Thanks

@sendaoYan
Copy link
Member Author

sendaoYan commented Jan 15, 2025

Close this PR as JDK-8313396 has been backouted.

@sendaoYan sendaoYan closed this Jan 15, 2025
@sendaoYan sendaoYan deleted the jbs8347649 branch January 15, 2025 01:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

hotspot hotspot-dev@openjdk.org rfr Pull request is ready for review

Development

Successfully merging this pull request may close these issues.

4 participants