From 42c804470c346fc0f796464d3adec9768a2bcc26 Mon Sep 17 00:00:00 2001 From: Markus Teich Date: Wed, 22 Jun 2016 23:29:15 +0200 Subject: [PATCH] fix warning with unused return codes only used in assertions. It's common knowledge to not cause any writes inside an assertion condition since they are not guaranteed to be executed, so we can still evaluate them and cast to void, which the compiler can optimize away. It's better than having a `(void)rc;` for every variable that is only used in assertions. --- util.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/util.h b/util.h index 4af3f74..9be0b62 100644 --- a/util.h +++ b/util.h @@ -32,9 +32,9 @@ void weprintf(const char *fmt, ...); #ifdef NDEBUG -# define brandt_assert(expr) ((void)(0)) -# define brandt_assert_perror(errnum) ((void)(0)) -# define brandt_assert_gpgerr(errnum) ((void)(0)) +# define brandt_assert(expr) ((void)(expr)) +# define brandt_assert_perror(errnum) ((void)(errnum)) +# define brandt_assert_gpgerr(errnum) ((void)(errnum)) #else