RFR: 8313396: Portable implementation of FORBID_C_FUNCTION and ALLOW_C_FUNCTION [v2]

Kim Barrett kbarrett at openjdk.org
Sat Jan 4 10:22:35 UTC 2025


On Thu, 2 Jan 2025 22:19:00 GMT, Martin Doerr <mdoerr at openjdk.org> wrote:

> Unfortunately, this doesn't compile on AIX:
> 
> ```
> globalDefinitions_gcc.hpp:42:
> In file included from /opt/IBM/openxlC/17.1.1/bin/../include/c++/v1/stdlib.h:93:
> /usr/include/stdlib.h:304:18: error: 'noreturn' attribute does not appear on the first declaration
>         extern _NOTHROW(_NORETURN(void, exit), (int));
>                         ^
> /usr/include/comp_macros.h:30:35: note: expanded from macro '_NORETURN'
> #define _NORETURN(_T, _F) _T _F [[noreturn]]
>                                   ^
>    ... (rest of output omitted)
> ```

Thanks for testing that port.

I restructured the implementation of FORBID_C_FUNCTION, and added more commentary about the clang issue.
I think that didn't change the resulting expansion, but I think made it easier to describe how I tried to address this
problem.  The actual "solution" (I hope) is to ensure that <stdlib.h> is included before the forbidding declarations
for the noreturn functions.  Please try an aix build again.

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

PR Comment: https://git.openjdk.org/jdk/pull/22890#issuecomment-2571149222


More information about the hotspot-dev mailing list