Skip to content

Commit

Permalink
Suppress GCC warnings (#357)
Browse files Browse the repository at this point in the history
  • Loading branch information
s-hadinger committed Jul 15, 2023
1 parent 1125c12 commit 2b4ea88
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/be_api.c
Original file line number Diff line number Diff line change
Expand Up @@ -1038,6 +1038,9 @@ BERRY_API int be_pcall(bvm *vm, int argc)
return be_protectedcall(vm, f, argc);
}

#ifdef __GNUC__
__attribute__((noreturn))
#endif
BERRY_API void be_raise(bvm *vm, const char *except, const char *msg)
{
be_pushstring(vm, except);
Expand All @@ -1049,6 +1052,9 @@ BERRY_API void be_raise(bvm *vm, const char *except, const char *msg)
be_pop(vm, 2);
be_save_stacktrace(vm);
be_throw(vm, BE_EXCEPTION);
#ifdef __GNUC__
__builtin_unreachable();
#endif
}

BERRY_API void be_stop_iteration(bvm *vm)
Expand Down
3 changes: 3 additions & 0 deletions src/berry.h
Original file line number Diff line number Diff line change
Expand Up @@ -2064,6 +2064,9 @@ BERRY_API void be_exit(bvm *vm, int status);
* @param except
* @param msg
*/
#ifdef __GNUC__
__attribute__((noreturn))
#endif
BERRY_API void be_raise(bvm *vm, const char *except, const char *msg);

/**
Expand Down

0 comments on commit 2b4ea88

Please sign in to comment.