-
Notifications
You must be signed in to change notification settings - Fork 6.2k
8367282: FORBID_C_FUNCTION needs exception spec consistent with library declaration #27180
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 kbarrett! A progress list of the required criteria for merging this PR into |
@kimbarrett This change now passes all automated pre-integration checks. ℹ️ This project also has non-automated pre-integration requirements. Please see the file CONTRIBUTING.md for details. 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 60 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 |
@kimbarrett The following label will be automatically applied to this pull request:
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. |
Webrevs
|
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.
Seems reasonable. Thanks for getting this sorted out.
|
||
#define FORBID_NORETURN_C_FUNCTION(Signature, Alternative) \ | ||
FORBID_C_FUNCTION(FORBIDDEN_FUNCTION_NORETURN_ATTRIBUTE Signature, Alternative) | ||
#define FORBID_NORETURN_C_FUNCTION(Signature, Noexcept, Alternative) \ |
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.
Is the added whitespace after ')' intended ?
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 for noticing. Will fix.
Bad news from AIX, with this patch included we get build errors like this
|
Tested and found to work on FreeBSD Aarch64 (with all my still out-of-tree patches applied.) |
Seems the forbidden sprintf AND snprintf cause the trouble on AIX, if I uncomment those 2 from forbiddenFunctions.hpp on top of this patch
the rest of forbidden functions causes no trouble on AIX, the build is successful. |
Thanks for checking that! |
I was afraid something like this might turn up. I can hack around the |
@@ -119,8 +119,10 @@ | |||
extern "C" { \ | |||
[[deprecated(Alternative)]] \ | |||
Signature \ | |||
/* Not PASTE_TOKENS, which expands FFCN => nothing. */ \ | |||
FORBIDDEN_FUNCTION_COND_NOEXCEPT_ ## Noexcept \ | |||
/* 2-step pasting to avoid expansion of FFCN => nothing. */ \ |
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.
Was this an issue with AIX or is this just a "better" way?
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.
This is needed in order to allow NOT_AIX(noexcept)
for the Noexcept
argument. We need pasting of the expansion, not direct pasting. Just using
direct ##
as before results in making something like
FORBIDDEN_FUNCTION_COND_NOEXCEPT_NOT_AIX(noexcept)
which isn't what we want here. And doing a single paste, e.g.
PASTE_TOKENS(FORBIDDEN_FUNCTION_COND_NOEXCEPT_, Noexcept)
expands the first argument to nothing, so we just get noexcept
, which isn't
what we want and doesn't work on platforms that don't declare their library
functions noexcept. The joys of macros...
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.
Works now on AIX as well, thanks !
Thanks for reviews @MBaesken and @dholmes-ora |
/integrate |
Going to push as commit 4e59c63.
Your commit was automatically rebased without conflicts. |
@kimbarrett Pushed as commit 4e59c63. 💡 You may see a message that your pull request was closed with unmerged commits. This can be safely ignored. |
Please review this change to FORBID_C_FUNCTION to make the exception specs of
the forbidding declarations match up with the exception specs of the
associated library declarations. This needs to account for different platform
libraries either having or not having exception specs. It's needed because,
after switching to C++17, some compilers complain about some differences in
the exception specs.
Also removed the workaround for JDK-8367051, which should no longer be needed
after this change.
Hoping someone will test the aix-ppc port. @MBaesken or @TheRealMDoerr ?
Testing: mach5 tier1, GHA sanity checks (nearly finished)
Locally (linux-aarch64) built with clang, which failed without the JDK-8367051
workaround.
Progress
Issue
Reviewers
Reviewing
Using
git
Checkout this PR locally:
$ git fetch https://git.openjdk.org/jdk.git pull/27180/head:pull/27180
$ git checkout pull/27180
Update a local copy of the PR:
$ git checkout pull/27180
$ git pull https://git.openjdk.org/jdk.git pull/27180/head
Using Skara CLI tools
Checkout this PR locally:
$ git pr checkout 27180
View PR using the GUI difftool:
$ git pr show -t 27180
Using diff file
Download this PR as a diff file:
https://git.openjdk.org/jdk/pull/27180.diff
Using Webrev
Link to Webrev Comment