From d279789e2356369d35d82abb2105494fb7f33645 Mon Sep 17 00:00:00 2001 From: Richard Fuchs Date: Wed, 13 Mar 2019 11:03:40 -0400 Subject: [PATCH] silence warnings when compiling with -DNDEBUG Change-Id: I46d16f6c083d281622ce71644bcf8d224e0b36b7 --- daemon/bencode.c | 2 ++ daemon/control_ng.c | 1 + include/dtls.h | 1 + lib/auxlib.h | 1 + lib/bitstr.h | 1 + 5 files changed, 6 insertions(+) diff --git a/daemon/bencode.c b/daemon/bencode.c index 9044d2a05..4b4eb12e5 100644 --- a/daemon/bencode.c +++ b/daemon/bencode.c @@ -327,6 +327,7 @@ static int __bencode_iovec_dump(struct iovec *out, bencode_item_t *item) { out += __bencode_iovec_cpy(out, &item->iov[1], 1); assert((out - orig) == item->iov_cnt); + (void) orig; return item->iov_cnt; } @@ -349,6 +350,7 @@ static int __bencode_str_dump(char *out, bencode_item_t *item) { out += __bencode_str_cpy(out, &item->iov[1], 1); assert((out - orig) == item->str_len); + (void) orig; *out = '\0'; return item->str_len; } diff --git a/daemon/control_ng.c b/daemon/control_ng.c index 8a59decce..8d2ecd6a0 100644 --- a/daemon/control_ng.c +++ b/daemon/control_ng.c @@ -135,6 +135,7 @@ static void control_ng_incoming(struct obj *obj, str *buf, const endpoint_t *sin int ret = bencode_buffer_init(&bencbuf); assert(ret == 0); + (void) ret; resp = bencode_dictionary(&bencbuf); assert(resp != NULL); diff --git a/include/dtls.h b/include/dtls.h index 2733d1eac..cc820240d 100644 --- a/include/dtls.h +++ b/include/dtls.h @@ -83,6 +83,7 @@ INLINE void __dtls_hash(const struct dtls_hash_func *hash_func, X509 *cert, unsi assert(bufsize >= hash_func->num_bytes); n = hash_func->__func(out, cert); assert(n == hash_func->num_bytes); + (void) n; } #define dtls_hash(hash_func, cert, outbuf) __dtls_hash(hash_func, cert, outbuf, sizeof(outbuf)) diff --git a/lib/auxlib.h b/lib/auxlib.h index d433539d6..637464ab8 100644 --- a/lib/auxlib.h +++ b/lib/auxlib.h @@ -68,6 +68,7 @@ int uint32_eq(const void *a, const void *b); INLINE void random_string(unsigned char *buf, int len) { int ret = RAND_bytes(buf, len); assert(ret == 1); + (void) ret; } diff --git a/lib/bitstr.h b/lib/bitstr.h index ad530c5bd..6c0bb24a8 100644 --- a/lib/bitstr.h +++ b/lib/bitstr.h @@ -66,6 +66,7 @@ INLINE int bitstr_shift_ret(bitstr *b, unsigned int bits, str *ret) { unsigned int int_bytes = b->bit_offset / 8; int shift_ret = str_shift(&b->s, int_bytes); assert(shift_ret == 0); + (void) shift_ret; b->bit_offset -= int_bytes * 8; return 0;