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

Martin Doerr mdoerr at openjdk.org
Sun Jan 5 14:55:38 UTC 2025


On Sat, 4 Jan 2025 10:19:29 GMT, Kim Barrett <kbarrett 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.

Thanks! This has solved one of the problems, but not all. The next one is:

globalDefinitions_gcc.hpp:55:
In file included from /usr/include/fcntl.h:242:
/usr/include/unistd.h:181:8: error: 'noreturn' attribute does not appear on the first declaration
extern _NORETURN(void, _exit)(int);
       ^
/usr/include/comp_macros.h:30:35: note: expanded from macro '_NORETURN'
#define _NORETURN(_T, _F) _T _F [[noreturn]]

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

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


More information about the graal-dev mailing list