r3945 - trunk/birnet



Author: timj
Date: 2006-10-07 18:00:51 -0400 (Sat, 07 Oct 2006)
New Revision: 3945

Modified:
   trunk/birnet/ChangeLog
   trunk/birnet/birnetcdefs.h
Log:
Sat Oct  7 23:58:58 2006  Tim Janik  <timj gtk org>                                                                                                           
                                                                                                                                                              
        * birnetcdefs.h (BIRNET_ABORT_NORETURN): added noreturn call to macros                                                                                
        which can't return, to silence compiler in some cases.                                                                                                
                                                                                                                                                              



Modified: trunk/birnet/ChangeLog
===================================================================
--- trunk/birnet/ChangeLog	2006-10-07 21:02:27 UTC (rev 3944)
+++ trunk/birnet/ChangeLog	2006-10-07 22:00:51 UTC (rev 3945)
@@ -1,3 +1,8 @@
+Sat Oct  7 23:58:58 2006  Tim Janik  <timj gtk org>
+
+	* birnetcdefs.h (BIRNET_ABORT_NORETURN): added noreturn call to macros 
+	which can't return, to silence compiler in some cases.
+
 Sat Oct  7 18:32:00 2006  Tim Janik  <timj gtk org>
 
 	* birnetcdefs.h: moved non-symbol C API bits from birnetcore.h and

Modified: trunk/birnet/birnetcdefs.h
===================================================================
--- trunk/birnet/birnetcdefs.h	2006-10-07 21:02:27 UTC (rev 3944)
+++ trunk/birnet/birnetcdefs.h	2006-10-07 22:00:51 UTC (rev 3945)
@@ -53,12 +53,14 @@
 /* --- assertions and runtime errors --- */
 #define BIRNET_RETURN_IF_FAIL(e)	do { if (BIRNET_ISLIKELY (e)) break; BIRNET__RUNTIME_PROBLEM ('R', BIRNET_LOG_DOMAIN, __FILE__, __LINE__, BIRNET_SIMPLE_FUNCTION, "%s", #e); return; } while (0)
 #define BIRNET_RETURN_VAL_IF_FAIL(e,v)	do { if (BIRNET_ISLIKELY (e)) break; BIRNET__RUNTIME_PROBLEM ('R', BIRNET_LOG_DOMAIN, __FILE__, __LINE__, BIRNET_SIMPLE_FUNCTION, "%s", #e); return v; } while (0)
-#define BIRNET_ASSERT(e)		do { if (BIRNET_ISLIKELY (e)) break; BIRNET__RUNTIME_PROBLEM ('A', BIRNET_LOG_DOMAIN, __FILE__, __LINE__, BIRNET_SIMPLE_FUNCTION, "%s", #e); *(void*volatile*)0; } while (0)
-#define BIRNET_ASSERT_NOT_REACHED()	do { BIRNET__RUNTIME_PROBLEM ('N', BIRNET_LOG_DOMAIN, __FILE__, __LINE__, BIRNET_SIMPLE_FUNCTION, NULL); } while (0)
+#define BIRNET_ASSERT(e)		do { if (BIRNET_ISLIKELY (e)) break; BIRNET__RUNTIME_PROBLEM ('A', BIRNET_LOG_DOMAIN, __FILE__, __LINE__, BIRNET_SIMPLE_FUNCTION, "%s", #e); while (1) *(void*volatile*)0; } while (0)
+#define BIRNET_ASSERT_NOT_REACHED()	do { BIRNET__RUNTIME_PROBLEM ('N', BIRNET_LOG_DOMAIN, __FILE__, __LINE__, BIRNET_SIMPLE_FUNCTION, NULL); BIRNET_ABORT_NORETURN(); } while (0)
 #define BIRNET_WARNING(...)		do { BIRNET__RUNTIME_PROBLEM ('W', BIRNET_LOG_DOMAIN, __FILE__, __LINE__, BIRNET_SIMPLE_FUNCTION, __VA_ARGS__); } while (0)
-#define BIRNET_ERROR(...)		do { BIRNET__RUNTIME_PROBLEM ('E', BIRNET_LOG_DOMAIN, __FILE__, __LINE__, BIRNET_SIMPLE_FUNCTION, __VA_ARGS__); *(void*volatile*)0; } while (0)
+#define BIRNET_ERROR(...)		do { BIRNET__RUNTIME_PROBLEM ('E', BIRNET_LOG_DOMAIN, __FILE__, __LINE__, BIRNET_SIMPLE_FUNCTION, __VA_ARGS__); BIRNET_ABORT_NORETURN(); } while (0)
+#define BIRNET_ABORT_NORETURN()		birnet_abort_noreturn()
 /* the above macros rely on a problem handler macro: */
 // BIRNET__RUNTIME_PROBLEM(ErrorWarningReturnAssertNotreach,domain,file,line,funcname,exprformat,...); // noreturn cases: 'E', 'A', 'N'
+extern inline void __attribute__ ((noreturn)) birnet_abort_noreturn (void) { while (1) *(void*volatile*)0; }
 
 /* --- convenient aliases --- */
 #ifdef  _BIRNET_SOURCE_EXTENSIONS




[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]