On Mon, 18 Jul 2005, [EMAIL PROTECTED] wrote:
> Unless I do the following I get the "Meaningless use of exression"
> from the compiler:
>
> diff -ru openssl-0.9.8/crypto/bn/bn_recp.c
> openssl-0.9.8-QNX/crypto/bn/bn_recp.c
> --- openssl-0.9.8/crypto/bn/bn_recp.c 2005-04-26 22:53:13.000000000 +0400
> +++ openssl-0.9.8-QNX4/crypto/bn/bn_recp.c 2005-07-17
> 22:44:12.000000000 +0400
> @@ -204,8 +204,10 @@
> ret=1;
> err:
> BN_CTX_end(ctx);
> - if(dv) bn_check_top(dv);
> - if(rem) bn_check_top(rem);
> + if(dv)
> + bn_check_top(dv);
> + if(rem)
> + bn_check_top(rem);
> return(ret);
i'm surprised the compiler isn't still bitching...
there's a bug here...
see crypto/bn/bn.h -- bn_check_top() is defined to an empty string when
BN_DEBUG is undefined... this can cause all sorts of havoc with a sequence
like the above... the compiler is really seeing if(dv) if(rem)
return(ret); ... nasty.
i think the real fix is something like this:
-dean
--- openssl-0.9.8/crypto/bn/bn.h.orig 2005-06-28 04:52:52.000000000 -0700
+++ openssl-0.9.8/crypto/bn/bn.h 2005-07-17 19:58:28.299414808 -0700
@@ -708,8 +708,8 @@
#else /* !BN_DEBUG */
-#define bn_pollute(a)
-#define bn_check_top(a)
+#define bn_pollute(a) do { } while(0)
+#define bn_check_top(a) do { } while(0)
#define bn_fix_top(a) bn_correct_top(a)
#endif
______________________________________________________________________
OpenSSL Project http://www.openssl.org
Development Mailing List [email protected]
Automated List Manager [EMAIL PROTECTED]