Mesa (master): util: Make unreachable at least be an assert

Carl Worth cworth at kemper.freedesktop.org
Fri Jan 16 21:58:39 UTC 2015


Module: Mesa
Branch: master
Commit: 62d5b4b03aa63582cf0801d306d7ca055cca40a0
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=62d5b4b03aa63582cf0801d306d7ca055cca40a0

Author: Carl Worth <cworth at cworth.org>
Date:   Fri Dec  5 08:05:44 2014 -0800

util: Make unreachable at least be an assert

Previously, if __builtin_unreachable() was unavailable, the
unreachable macro was defined to do nothing. We do better here, by at
least still making it an assert.

Reviewed-by: Ian Romanick <ian.d.romanick at intel.com>

---

 src/util/macros.h |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/util/macros.h b/src/util/macros.h
index 5fc6729..eec8b93 100644
--- a/src/util/macros.h
+++ b/src/util/macros.h
@@ -82,7 +82,7 @@ do {                        \
 #endif
 
 #ifndef unreachable
-#define unreachable(str)
+#define unreachable(str) assert(!str)
 #endif
 
 /**




More information about the mesa-commit mailing list