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.
This commit is contained in:
Markus Teich 2016-06-22 23:29:15 +02:00
parent 0fc7fb86b8
commit 42c804470c

6
util.h
View File

@ -32,9 +32,9 @@ void weprintf(const char *fmt, ...);
#ifdef NDEBUG #ifdef NDEBUG
# define brandt_assert(expr) ((void)(0)) # define brandt_assert(expr) ((void)(expr))
# define brandt_assert_perror(errnum) ((void)(0)) # define brandt_assert_perror(errnum) ((void)(errnum))
# define brandt_assert_gpgerr(errnum) ((void)(0)) # define brandt_assert_gpgerr(errnum) ((void)(errnum))
#else #else