Skip to content

Define mmk_noreturn if __STDC_VERSION__ >= 201112L#40

Open
christophebedard wants to merge 1 commit intoSnaipe:masterfrom
christophebedard:christophebedard/upstream-define-mmk-noreturn-c11
Open

Define mmk_noreturn if __STDC_VERSION__ >= 201112L#40
christophebedard wants to merge 1 commit intoSnaipe:masterfrom
christophebedard:christophebedard/upstream-define-mmk-noreturn-c11

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