RFR: 8313396: Portable implementation of FORBID_C_FUNCTION and ALLOW_C_FUNCTION

Julian Waters jwaters at openjdk.org
Wed Jan 24 08:04:51 UTC 2024


On Fri, 12 Jan 2024 06:16:25 GMT, Julian Waters <jwaters at openjdk.org> wrote:

> Please review a portable implementation of FORBID_C_FUNCTION and ALLOW_C_FUNCTION:
> 
> Currently, FORBID_C_FUNCTION only works for gcc like compilers, and ALLOW_C_FUNCTION acts to disable CRT warnings on Windows, where FORBID_C_FUNCTION does not work. It would be beneficial to provide a universal portable definition for both, to allow the macros to work on all platforms HotSpot can be compiled for.
> 
> The implementation is portable and _should_ work on all HotSpot supported platforms (I don't have an AIX device!).
> 
> Regrettably, I did end up having to change the signature of ALLOW_C_FUNCTION to work with this new implementation, as well as the way it is used. On one hand, it is more compact than before, but on the other the established syntax is likely more familiar by this point. I do hope this is not a showstopper, but understand if it is

@kimbarrett This isn't ready for review yet, but I think I might need your help, how was your original approach able to avoid firing warnings and errors when use of forbidden methods was encountered in third party code, such as GTest? Looking at the logs mine is failing because the forbidden methods are being detected in GTest code as invalid

Opening to review, because I really need help with this

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

PR Comment: https://git.openjdk.org/jdk/pull/17387#issuecomment-1902512575
PR Comment: https://git.openjdk.org/jdk/pull/17387#issuecomment-1907588682


More information about the hotspot-dev mailing list