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.
This commit is contained in:
@@ -39,7 +39,7 @@ subject to the following restrictions:
|
||||
#include <assert.h>
|
||||
#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.
|
||||
|
||||
Reference in New Issue
Block a user