Fix unused variable warning
authorEmilia Kasper <emilia@openssl.org>
Mon, 15 Dec 2014 12:11:52 +0000 (13:11 +0100)
committerEmilia Kasper <emilia@openssl.org>
Mon, 15 Dec 2014 12:19:09 +0000 (13:19 +0100)
The temporary variable causes unused variable warnings in opt mode with clang,
because the subsequent assert is compiled out.

Reviewed-by: Rich Salz <rsalz@openssl.org>
(cherry picked from commit 6af16ec5eed85390bcbd004806a842d6153d6a31)

crypto/bn/bn.h

index 21a1a3fe35c0842a9583e4770d62350af8d8c50c..c4d618522e265aaf3a40a18454ea0230b0397ff8 100644 (file)
@@ -780,7 +780,9 @@ int RAND_pseudo_bytes(unsigned char *buf,int num);
 #define bn_wcheck_size(bn, words) \
        do { \
                const BIGNUM *_bnum2 = (bn); \
-               assert(words <= (_bnum2)->dmax && words >= (_bnum2)->top); \
+               assert((words) <= (_bnum2)->dmax && (words) >= (_bnum2)->top); \
+               /* avoid unused variable warning with NDEBUG */ \
+               (void)(_bnum2); \
        } while(0)
 
 #else /* !BN_DEBUG */