Skip to content

CDRIVER-5889: Fix BSON_NORETURN for C23 standard #1859

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

Merged
1 commit merged into from Feb 11, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions src/libbson/src/bson/bson-macros.h
Original file line number Diff line number Diff line change
Expand Up @@ -200,7 +200,7 @@


#if defined(__STDC_VERSION__) && __STDC_VERSION__ >= 202311L
#define BSON_NORETURN noreturn
#define BSON_NORETURN [[noreturn]]
#elif defined(__STDC_VERSION__) && __STDC_VERSION__ >= 201112L
#define BSON_NORETURN _Noreturn
#elif defined(__GNUC__) && 2 < __GNUC__ + (8 <= __GNUC_MINOR__)
Expand All @@ -210,14 +210,14 @@
#endif


static BSON_INLINE BSON_NORETURN void
BSON_NORETURN static BSON_INLINE void
_bson_assert_failed_on_line (const char *file, int line, const char *func, const char *test)
{
fprintf (stderr, "%s:%d %s(): assertion failed: %s\n", file, line, func, test);
abort ();
}

static BSON_INLINE BSON_NORETURN void
BSON_NORETURN static BSON_INLINE void
_bson_assert_failed_on_param (const char *param, const char *func)
{
fprintf (stderr, "The parameter: %s, in function %s, cannot be NULL\n", param, func);
Expand Down