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

Define mmk_noreturn if __STDC_VERSION__ >= 201112L #40

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

christophebedard
Copy link

If CMAKE_C_STANDARD is set to 11 (e.g., globally), then mmk_noreturn is never defined, which results in errors like this:

In file included from /home/user/ros2_ws/build/mimick_vendor/mimick_vendor-prefix/src/mimick_vendor/src/plt.c:25:
/home/user/ros2_ws/build/mimick_vendor/mimick_vendor-prefix/src/mimick_vendor/src/vitals.h:46:13: error: expected ‘;’ before ‘void’
   46 | mmk_noreturn void mmk_panic(const char *, ...);
      |             ^~~~~
      |             ;

_Noreturn is deprecated in C23, but I'm not sure if we should worry about that just yet. See https://en.cppreference.com/w/c/language/_Noreturn.

Relates to #28, but using C99 is not really a great solution.

Signed-off-by: Christophe Bedard <bedard.christophe@gmail.com>
@christophebedard christophebedard force-pushed the christophebedard/upstream-define-mmk-noreturn-c11 branch from 92d2c95 to 8ea6431 Compare February 17, 2025 20:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant