Does anyone ever clean up warnings in bullet?

kraythe
Posts: 9
Joined: Mon Aug 06, 2012 8:27 am

Does anyone ever clean up warnings in bullet?

Post by kraythe »

Normally i have all of my warnings cranked up to the max but with bullet I cant do that. Here is a list of warnings I got when compiling with minimum settings.

Code: Select all

/Users/kraythe/dev/Beads/Beads/Ball.mm
/Users/kraythe/dev/bullet-2.80-rev2531/src/BulletCollision/CollisionDispatch/btBox2dBox2dCollisionAlgorithm.cpp
/Users/kraythe/dev/bullet-2.80-rev2531/src/BulletCollision/CollisionDispatch/btBox2dBox2dCollisionAlgorithm.cpp:371:12: Unused variable 'dv'
/Users/kraythe/dev/bullet-2.80-rev2531/src/BulletCollision/CollisionDispatch/btConvexConvexAlgorithm.cpp
/Users/kraythe/dev/bullet-2.80-rev2531/src/BulletCollision/CollisionDispatch/btConvexConvexAlgorithm.cpp:317:13: Unused variable 'localScalingA'
/Users/kraythe/dev/bullet-2.80-rev2531/src/BulletCollision/CollisionDispatch/btConvexConvexAlgorithm.cpp:318:13: Unused variable 'localScalingB'
/Users/kraythe/dev/bullet-2.80-rev2531/src/BulletCollision/CollisionDispatch/btInternalEdgeUtility.cpp
/Users/kraythe/dev/bullet-2.80-rev2531/src/BulletCollision/CollisionDispatch/btInternalEdgeUtility.cpp:485:12: Unused variable 'center'
/Users/kraythe/dev/bullet-2.80-rev2531/src/BulletCollision/CollisionDispatch/SphereTriangleDetector.cpp
/Users/kraythe/dev/bullet-2.80-rev2531/src/BulletCollision/CollisionDispatch/SphereTriangleDetector.cpp:161:14: Unused variable 'distance'
/Users/kraythe/dev/bullet-2.80-rev2531/src/LinearMath/btGrahamScan2dConvexHull.h
/Users/kraythe/dev/bullet-2.80-rev2531/src/LinearMath/btGrahamScan2dConvexHull.h:73:55: '&&' within '||'
/Users/kraythe/dev/bullet-2.80-rev2531/src/BulletCollision/CollisionShapes/btPolyhedralConvexShape.cpp
/Users/kraythe/dev/bullet-2.80-rev2531/src/BulletCollision/CollisionShapes/btPolyhedralConvexShape.cpp:110:12: Unused variable 'maxCross2'
/Users/kraythe/dev/bullet-2.80-rev2531/src/BulletCollision/CollisionShapes/btPolyhedralConvexShape.cpp:111:7: Unused variable 'chosenEdge'
/Users/kraythe/dev/bullet-2.80-rev2531/src/BulletCollision/CollisionShapes/btStridingMeshInterface.cpp
/Users/kraythe/dev/bullet-2.80-rev2531/src/BulletCollision/CollisionShapes/btStridingMeshInterface.cpp:245:13: Unused variable 'meshScaling'
/Users/kraythe/dev/bullet-2.80-rev2531/src/BulletCollision/NarrowPhaseCollision/btContinuousConvexCollision.cpp
/Users/kraythe/dev/bullet-2.80-rev2531/src/BulletCollision/NarrowPhaseCollision/btContinuousConvexCollision.cpp:65:8: Unused variable 'hasCollision'
/Users/kraythe/dev/bullet-2.80-rev2531/src/BulletCollision/NarrowPhaseCollision/btPolyhedralContactClipping.cpp
/Users/kraythe/dev/bullet-2.80-rev2531/src/BulletCollision/NarrowPhaseCollision/btPolyhedralContactClipping.cpp:315:6: Unused variable 'numContacts'
/Users/kraythe/dev/bullet-2.80-rev2531/src/BulletCollision/NarrowPhaseCollision/btPolyhedralContactClipping.cpp:409:11: Unused variable 'curMaxDist'
/Users/kraythe/dev/bullet-2.80-rev2531/src/BulletCollision/NarrowPhaseCollision/btPolyhedralContactClipping.cpp:406:18: Unused variable 'DeltaC2'
/Users/kraythe/dev/bullet-2.80-rev2531/src/BulletDynamics/ConstraintSolver/btConeTwistConstraint.cpp
/Users/kraythe/dev/bullet-2.80-rev2531/src/BulletDynamics/ConstraintSolver/btConeTwistConstraint.cpp:509:15: Unused variable 'impulse'
/Users/kraythe/dev/bullet-2.80-rev2531/src/BulletDynamics/ConstraintSolver/btConeTwistConstraint.cpp:980:15: Unused variable 'qABCur'
/Users/kraythe/dev/bullet-2.80-rev2531/src/BulletDynamics/ConstraintSolver/btConeTwistConstraint.cpp:982:15: Unused variable 'qConstraintCur'
/Users/kraythe/dev/bullet-2.80-rev2531/src/BulletDynamics/ConstraintSolver/btGeneric6DofConstraint.cpp
/Users/kraythe/dev/bullet-2.80-rev2531/src/BulletDynamics/ConstraintSolver/btGeneric6DofConstraint.cpp:226:12: Unused variable 'motorImp'
/Users/kraythe/dev/bullet-2.80-rev2531/src/BulletDynamics/ConstraintSolver/btGeneric6DofConstraint.cpp:350:12: Unused variable 'impulse_vector'
/Users/kraythe/dev/bullet-2.80-rev2531/src/BulletDynamics/ConstraintSolver/btGeneric6DofSpringConstraint.cpp
/Users/kraythe/dev/bullet-2.80-rev2531/src/BulletDynamics/ConstraintSolver/btGeneric6DofSpringConstraint.cpp:121:12: Unused variable 'relVel'
/Users/kraythe/dev/bullet-2.80-rev2531/src/BulletDynamics/ConstraintSolver/btPoint2PointConstraint.cpp
/Users/kraythe/dev/bullet-2.80-rev2531/src/BulletDynamics/ConstraintSolver/btPoint2PointConstraint.cpp:127:13: Unused variable 'a2n'
/Users/kraythe/dev/bullet-2.80-rev2531/src/BulletDynamics/ConstraintSolver/btHingeConstraint.cpp
/Users/kraythe/dev/bullet-2.80-rev2531/src/BulletDynamics/ConstraintSolver/btHingeConstraint.cpp:705:12: Unused variable 'pivotAInW'
/Users/kraythe/dev/bullet-2.80-rev2531/src/BulletDynamics/ConstraintSolver/btHingeConstraint.cpp:706:12: Unused variable 'pivotBInW'
/Users/kraythe/dev/bullet-2.80-rev2531/src/BulletDynamics/ConstraintSolver/btSequentialImpulseConstraintSolver.cpp
/Users/kraythe/dev/bullet-2.80-rev2531/src/BulletDynamics/ConstraintSolver/btSequentialImpulseConstraintSolver.cpp:961:22: Unused variable 'info'
/Users/kraythe/dev/bullet-2.80-rev2531/src/BulletSoftBody/btSoftBody.cpp
/Users/kraythe/dev/bullet-2.80-rev2531/src/BulletSoftBody/btSoftBody.cpp:463:17: Unused variable 'kPR'
/Users/kraythe/dev/bullet-2.80-rev2531/src/BulletSoftBody/btSoftBody.cpp:464:17: Unused variable 'kVC'
/Users/kraythe/dev/bullet-2.80-rev2531/src/BulletSoftBody/btSoftBody.cpp:539:17: Unused variable 'kVC'
/Users/kraythe/dev/bullet-2.80-rev2531/src/BulletSoftBody/btSoftBody.cpp:538:17: Unused variable 'kPR'
/Users/kraythe/dev/bullet-2.80-rev2531/src/BulletSoftBody/btSoftBody.cpp:1590:18: Unused variable 'd'
/Users/kraythe/dev/bullet-2.80-rev2531/src/BulletSoftBody/btSoftBody.cpp:2877:21: Unused variable 'f'
/Users/kraythe/dev/bullet-2.80-rev2531/src/BulletSoftBody/btSoftBody.cpp:2820:21: Unused variable 'dt'
/Users/kraythe/dev/bullet-2.80-rev2531/src/BulletSoftBody/btSoftBody.cpp:2831:18: Unused variable 'as_vaero'
/Users/kraythe/dev/bullet-2.80-rev2531/src/BulletSoftBody/btSoftBody.cpp:2833:18: Unused variable 'as_faero'
/Users/kraythe/dev/bullet-2.80-rev2531/src/LinearMath/btConvexHull.cpp
/Users/kraythe/dev/bullet-2.80-rev2531/src/LinearMath/btConvexHull.cpp:573:8: Unused variable 'ti'
Sam Hocevar
Posts: 1
Joined: Fri Aug 17, 2012 10:01 am

Re: Does anyone ever clean up warnings in bullet?

Post by Sam Hocevar »

I wonder about this too. I compile with

Code: Select all

-Wall -Wextra -Wpointer-arith -Wcast-align -Wcast-qual -Wshadow -Wsign-compare
which are all absolutely sane warnings and helped us find bugs in the past, but with Bullet enabled we get literally thousands of warnings in our projects.
User avatar
mackron
Posts: 2
Joined: Sun Jun 24, 2012 12:00 pm

Re: Does anyone ever clean up warnings in bullet?

Post by mackron »

Indeed, this is what I wrap my Bullet includes in:

Code: Select all

#if defined(_MSC_VER)
    #pragma warning(push)
    #pragma warning(disable:4127)   // Conditional expression is constant.
    #pragma warning(disable:4100)   // Unreferenced formal parameter.
    #pragma warning(disable:4324)   // structure was padded due to __declspec(align())
#elif defined(__GNUC__)
    #pragma GCC diagnostic push
    #pragma GCC diagnostic ignored "-Weffc++"
    #pragma GCC diagnostic ignored "-Wsign-conversion"
    #pragma GCC diagnostic ignored "-Wswitch-default"
    #pragma GCC diagnostic ignored "-Wunused-parameter"
    #pragma GCC diagnostic ignored "-Winline"
    #pragma GCC diagnostic ignored "-Wuninitialized"
    #if (__GNUC__ > 4) || ((__GNUC__ == 4) && (__GNUC_MINOR__ >= 7))
        #pragma GCC diagnostic ignored "-Wmaybe-uninitialized"
    #endif
#endif
I had actually considered doing a few contributions to fix some warnings in the header files. Maybe when/if Bullet ends up on github (hint, hint) I'll do a fork where it's a bit more convenient... Would be interesting to see if some of these warnings are indeed pointing to subtle bugs in there somewhere...