Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCampbell Barton <ideasman42@gmail.com>2020-05-26 06:37:52 +0300
committerCampbell Barton <ideasman42@gmail.com>2020-05-26 06:40:21 +0300
commit495a98d623648ca787ddb2c0dbaa08fe313f1adf (patch)
tree1417f067dd83feb67c34ef7cfd53b992a509a336 /source/blender/blenlib/BLI_assert.h
parent4e8693ffcddbe580ddac21e305a085dd846a6c04 (diff)
BLI_assert: prevent abort from suppressing return-type warning
Recent commit deaff945d0b96 broke release builds but not debug builds, with this change the warning happens in both cases.
Diffstat (limited to 'source/blender/blenlib/BLI_assert.h')
-rw-r--r--source/blender/blenlib/BLI_assert.h8
1 files changed, 7 insertions, 1 deletions
diff --git a/source/blender/blenlib/BLI_assert.h b/source/blender/blenlib/BLI_assert.h
index b9cb32a310e..603be115b35 100644
--- a/source/blender/blenlib/BLI_assert.h
+++ b/source/blender/blenlib/BLI_assert.h
@@ -69,7 +69,13 @@ extern "C" {
# endif
/* _BLI_ASSERT_ABORT */
# ifdef WITH_ASSERT_ABORT
-# define _BLI_ASSERT_ABORT abort
+# ifdef __GNUC__
+/* Cast to remove 'noreturn' attribute since this suppresses missing return statements,
+ * allowing changes to debug builds to accidentally to break release builds. */
+# define _BLI_ASSERT_ABORT ((void (*)(void))(*(((void **)abort))))
+# else
+# define _BLI_ASSERT_ABORT abort
+# endif
# else
# define _BLI_ASSERT_ABORT() (void)0
# endif