gallium/aux/util/u_debug.h: Fix "noreturn" warnings in debug mode
authorGert Wollny <gert.wollny@collabora.com>
Tue, 5 Jun 2018 11:59:05 +0000 (13:59 +0200)
committerGert Wollny <gw.fossdev@gmail.com>
Wed, 20 Jun 2018 09:08:28 +0000 (11:08 +0200)
Only decorate function as noreturn when DEBUG is not defined, because
when compiled in DEBUG mode the function actually executes an int3 and
may return, fixes:
u_debug.c: In function '_debug_assert_fail':
u_debug.c:309:1: warning: 'noreturn' function does return

Signed-off-by: Gert Wollny <gert.wollny@collabora.com>
Reviewed-by: Emil Velikov <emil.velikov@collabora.com>
src/gallium/auxiliary/util/u_debug.h

index d2ea89f59c10e1bc0944b537ff1da54dbb5bb05c..4c3b8ba171c777fcd1f731de3a93d7111cfa4f78 100644 (file)
@@ -170,8 +170,8 @@ void _debug_assert_fail(const char *expr,
                         const char *file, 
                         unsigned line, 
                         const char *function)
-#ifdef __GNUC__
-   __attribute__((__noreturn__))
+#if defined(__GNUC__) && !defined(DEBUG)
+   __attribute__((noreturn))
 #endif
 ;