RFR: 8367282: FORBID_C_FUNCTION needs exception spec consistent with library declaration

Kim Barrett kbarrett at openjdk.org
Fri Sep 12 19:00:24 UTC 2025


On Wed, 10 Sep 2025 12:21:27 GMT, Matthias Baesken <mbaesken at openjdk.org> wrote:

>> 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.
>
> Seems the forbidden sprintf AND snprintf cause the trouble on AIX, if I uncomment those 2 from forbiddenFunctions.hpp  on top of this patch
> 
> /*
> FORBID_C_FUNCTION(int sprintf(char*, const char*, ...), noexcept, "use os::snprintf");
> FORBID_C_FUNCTION(int snprintf(char*, size_t, const char*, ...), noexcept, "use os::snprintf");
> */
> 
> the rest of forbidden functions causes no trouble on AIX, the build is successful.

Thanks for reviews @MBaesken and @dholmes-ora

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

PR Comment: https://git.openjdk.org/jdk/pull/27180#issuecomment-3286487853


More information about the hotspot-dev mailing list