From a4a3474fb518db9d86e54a91202d609d47766910 Mon Sep 17 00:00:00 2001 From: sjbaker Date: Tue, 6 Mar 2007 18:06:28 +0000 Subject: [PATCH] The macro 'btFullAssert' is used like this: btFullAssert ( yadda_yadda ) ; ...in the btScalar.h header, it's defined as: #define btFullAssert ...which means that the statement above becomes: ( yadda_yadda ) ; ...which means that code may actually be compiled and executed (unnecessarily) - and even when the code is something simple like: ( i > 0 && i < 3 ) ; ...the GCC tosses out a 'statement with no effect' warning - before it optimises away the code. The fix is: #define btFullAssert(x) ...so that the macro still takes a parameter which is now removed from the sources so you get: ; ...which is guaranteed not to generate code. --- src/LinearMath/btScalar.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/LinearMath/btScalar.h b/src/LinearMath/btScalar.h index 4e6952860..8fa49a593 100644 --- a/src/LinearMath/btScalar.h +++ b/src/LinearMath/btScalar.h @@ -39,7 +39,7 @@ subject to the following restrictions: #include #define btAssert assert //btFullAssert is optional, slows down a lot - #define btFullAssert + #define btFullAssert(x) #else //non-windows systems @@ -51,7 +51,7 @@ subject to the following restrictions: #endif #define btAssert assert //btFullAssert is optional, slows down a lot - #define btFullAssert + #define btFullAssert(x) #endif /// older compilers (gcc 3.x) and Sun needs double version of sqrt etc.