RFR: 8367282: FORBID_C_FUNCTION needs exception spec consistent with library declaration [v2]

Kim Barrett kbarrett at openjdk.org
Thu Sep 11 06:55:24 UTC 2025


On Thu, 11 Sep 2025 05:54:14 GMT, David Holmes <dholmes at openjdk.org> wrote:

>> Kim Barrett has updated the pull request incrementally with one additional commit since the last revision:
>> 
>>   work around AIX noexcept inconsistencies
>
> src/hotspot/share/utilities/compilerWarnings.hpp line 122:
> 
>> 120:     [[deprecated(Alternative)]]                                 \
>> 121:     Signature                                                   \
>> 122:     /* 2-step pasting to avoid expansion of FFCN => nothing. */ \
> 
> Was this an issue with AIX or is this just a "better" way?

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...

-------------

PR Review Comment: https://git.openjdk.org/jdk/pull/27180#discussion_r2338954298


More information about the hotspot-dev mailing list