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

Kim Barrett kbarrett at openjdk.org
Tue Jan 7 09:34:38 UTC 2025


On Sun, 5 Jan 2025 22:14:15 GMT, Kim Barrett <kbarrett at openjdk.org> wrote:

> > 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);
> >        ^
> > ```
> 
> Drat. I forgot that posix _exit comes from unistd.h. Back to work...

Hopefully that's fixed now too, and there won't be any more.
I also added _Exit to the forbidden set.

I looked into the more robust / less kludgy approaches, but they are more work than I want to do as part of this PR.
Maybe in a followup.  And I wonder if someone might file a bug about the clang weirdness?

This might be related, but seems kind of different:
https://github.com/llvm/llvm-project/issues/113511

Test case:

__attribute__((__noreturn__)) void frob(int);
[[noreturn]] void frob(int);

=>

'noreturn' attribute does not appear on the first declaration

gcc compiles this without error.

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

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


More information about the graal-dev mailing list