From 3f12ca57c453a9e757040b6a0fa816ac07c0d394 Mon Sep 17 00:00:00 2001 From: Philip Withnall Date: Wed, 9 Nov 2016 16:52:21 +0000 Subject: [PATCH] gtestutils: Clarify that g_assert() should not have side effects g_assert() gets completely compiled out if G_DISABLE_ASSERT is defined, so applications should not depend on side effects of the expression in an assertion. --- glib/gtestutils.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/glib/gtestutils.c b/glib/gtestutils.c index 3275cdab0..d4b0fbe29 100644 --- a/glib/gtestutils.c +++ b/glib/gtestutils.c @@ -380,7 +380,8 @@ * an error message is logged and the application is terminated. * * The macro can be turned off in final releases of code by defining - * `G_DISABLE_ASSERT` when compiling the application. + * `G_DISABLE_ASSERT` when compiling the application, so code must + * not depend on any side effects from @expr. */ /**