diff options
author | Markus Teich <markus.teich@stusta.mhn.de> | 2016-06-22 23:29:15 +0200 |
---|---|---|
committer | Markus Teich <markus.teich@stusta.mhn.de> | 2016-06-22 23:29:15 +0200 |
commit | 42c804470c346fc0f796464d3adec9768a2bcc26 (patch) | |
tree | 4a2e7aa72d535ff8868e6679866162ff44010ea4 | |
parent | 0fc7fb86b84e16daeabaea1fea455e65cc48b66e (diff) | |
download | libbrandt-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.h | 6 |
1 files changed, 3 insertions, 3 deletions
@@ -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 | ||