Erwin Coumans wrote:We could add that line in btScalar.h (without the version check), would that help you?
inline int bullet_btInfinityMask()
{
return btInfinityMask;
}
Depending on optimization levels and debug parameters (-g), inline functions may not be kept and compiled, so the warning could remain. Plus it's a definition of an unuseful function, and it lets btInfinityMask instantiated as a variable in each source file the header is included, just because of a cast.
I see two other solutions, IMHO a bit cleaner.
Fist the variable could be declared with the attribute "unused" (GCC and Clang handle this):
Code: Select all
__attribute((__unused__)) static int btInfinityMask = 0x7F800000;
Or, don't try to define BT_INFINITY, instead define btInfinityMask as macro and the following function:
Code: Select all
#define btInfinityMask 0x7F800000
static inline int btIsInfinity(float f) {
return (*(int*)&f) == btInfinityMask;
}