Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update XED_NORETURN to support modern C standards #333

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

blue42u
Copy link

@blue42u blue42u commented Sep 14, 2024

Fixes #332

The XED_NORETURN macro is incompatible with software using C11. Update the macro logic to use the C23 [[noreturn]] attribute syntax or C11 _Noreturn keyword respectively when the standard is in use. For compatibility with C99, the GNU extension __attribute__((__noreturn__)) is used as a fallback, which does not cause compile warnings if noreturn is a macro (e.g. from stdnoreturn.h).

The `XED_NORETURN` macro is incompatible with software using C11. This
commit updates the macro logic to use `[[noreturn]]` (C23) or
`_Noreturn` (C11) when the given standard is supported. The original
`__attribute__` syntax is kept, it now uses `__noreturn__` to avoid
conflicts if/when `noreturn` is a macro.

Signed-off-by: Jonathon Anderson <[email protected]>
@marjevan marjevan marked this pull request as draft September 15, 2024 06:05
@marjevan
Copy link
Member

A fix will be available with the upcoming external release.

@marjevan marjevan added the upcoming release A fix/support will be available with the upcoming external release label Sep 17, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
accepted upcoming release A fix/support will be available with the upcoming external release
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Using C11 stdnoreturn.h causes compiler warnings in headers
2 participants