diff --git a/source/blender/blenlib/BLI_assert.h b/source/blender/blenlib/BLI_assert.h index b9cb32a310e..f4c84929c6e 100644 --- a/source/blender/blenlib/BLI_assert.h +++ b/source/blender/blenlib/BLI_assert.h @@ -69,7 +69,21 @@ extern "C" { # endif /* _BLI_ASSERT_ABORT */ # ifdef WITH_ASSERT_ABORT -# define _BLI_ASSERT_ABORT abort + +/* Begin '_BLI_abort'. */ +/* Wrap the abort call to remove the 'noreturn' attribute since it suppresses + * the warning about missing return statements (breaking release builds). */ +# ifdef __GNUC__ /* Ensure this doesn't get reduced back to 'abort'. */ +__attribute__((noipa)) __attribute__((unused)) +# endif +static void +_BLI_abort(void) +{ + abort(); +} +/* End '_BLI_abort' */ + +# define _BLI_ASSERT_ABORT _BLI_abort # else # define _BLI_ASSERT_ABORT() (void)0 # endif