aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarkus Teich <markus.teich@stusta.mhn.de>2016-06-22 23:29:15 +0200
committerMarkus Teich <markus.teich@stusta.mhn.de>2016-06-22 23:29:15 +0200
commit42c804470c346fc0f796464d3adec9768a2bcc26 (patch)
tree4a2e7aa72d535ff8868e6679866162ff44010ea4
parent0fc7fb86b84e16daeabaea1fea455e65cc48b66e (diff)
downloadlibbrandt-42c804470c346fc0f796464d3adec9768a2bcc26.tar.gz
libbrandt-42c804470c346fc0f796464d3adec9768a2bcc26.zip
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.
-rw-r--r--util.h6
1 files 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, ...);
32 32
33#ifdef NDEBUG 33#ifdef NDEBUG
34 34
35# define brandt_assert(expr) ((void)(0)) 35# define brandt_assert(expr) ((void)(expr))
36# define brandt_assert_perror(errnum) ((void)(0)) 36# define brandt_assert_perror(errnum) ((void)(errnum))
37# define brandt_assert_gpgerr(errnum) ((void)(0)) 37# define brandt_assert_gpgerr(errnum) ((void)(errnum))
38 38
39#else 39#else
40 40