Weird use of assert() in codebase
jagoly opened this issue · 3 comments
The code is full of seemingly useless lines like "assert(foo >= 0);" where foo is an unsigned int. Why? It drives GCC mad with -Wtype-limits. If you could shed some light on this, it'd be great. I'm interested in using the library (which looks very nice, btw) in my project. Thanks.
Hi,
Of course, it does not really make sense if the variable is an unsigned int. Could you please let me know where you have seen those asserts in the code ?
There are a lot of them. Just as one random example, lines 222 and 223 in https://github.com/DanielChappuis/reactphysics3d/blob/master/src/collision/shapes/ConvexMeshShape.h
Just run GCC or whatever compiler you prefer with warnings enabled, it will give you a very long list of them.
This has been fixed in the version 0.6.0 of ReactPhysics3D that has just been released.