const char *func,
const char *expr)
{
- char *s = g_strconcat ("assertion failed: (", expr, ")", NULL);
+ char *s;
+ if (!expr)
+ s = g_strdup ("code should not be reached");
+ else
+ s = g_strconcat ("assertion failed: (", expr, ")", NULL);
g_assertion_message (domain, file, line, func, s);
g_free (s);
}
#define g_assert_not_reached() do { (void) 0; } while (0)
#define g_assert(expr) do { (void) 0; } while (0)
#else /* !G_DISABLE_ASSERT */
-#define g_assert_not_reached() do { g_assertion_message (G_LOG_DOMAIN, __FILE__, __LINE__, G_STRFUNC, NULL); } while (0)
+#define g_assert_not_reached() do { g_assertion_message_expr (G_LOG_DOMAIN, __FILE__, __LINE__, G_STRFUNC, NULL); } while (0)
#define g_assert(expr) do { if G_LIKELY (expr) ; else \
g_assertion_message_expr (G_LOG_DOMAIN, __FILE__, __LINE__, G_STRFUNC, \
#expr); } while (0)