SVN 4699 + gcc-4.3 = warnings :-)

SVN 4699 + gcc-4.3 = warnings :-)

Postby Quix0r » 13 Feb 2010, 02:09

Hi all,

I have downloaded the trunk for testing (I test a lot software with debug symbols on) and got some wired warnings:
{l Code}: {l Select All Code}
LinearMath/btConvexHull.cpp: In member function ‘bool HullLibrary::CleanupVertices(unsigned int, const btVector3*, unsigned int, unsigned int&, btVector3*, btScalar, btVector3&)’:
LinearMath/btConvexHull.cpp:860: warning: ‘recip[0]’ may be used uninitialized in this function
LinearMath/btConvexHull.cpp:860: warning: ‘recip[1]’ may be used uninitialized in this function
LinearMath/btConvexHull.cpp:860: warning: ‘recip[2]’ may be used uninitialized in this function
BulletCollision/BroadphaseCollision/btMultiSapBroadphase.h: In constructor ‘btMultiSapBroadphase::btMultiSapBroadphase(int, btOverlappingPairCache*)’:
BulletCollision/BroadphaseCollision/btMultiSapBroadphase.h:47: warning: ‘btMultiSapBroadphase::m_invalidPair’ will be initialized after
BulletCollision/BroadphaseCollision/btMultiSapBroadphase.h:40: warning:   ‘btOptimizedBvh* btMultiSapBroadphase::m_optimizedAabbTree’
BulletCollision/BroadphaseCollision/btMultiSapBroadphase.cpp:40: warning:   when initialized here
BulletCollision/BroadphaseCollision/btMultiSapBroadphase.cpp: In member function ‘virtual void btMultiSapBroadphase::setAabb(btBroadphaseProxy*, const btVector3&, const btVector3&, btDispatcher*)’:
BulletCollision/BroadphaseCollision/btMultiSapBroadphase.cpp:160: warning: unused variable ‘fullyContained’
BulletCollision/BroadphaseCollision/btMultiSapBroadphase.cpp:161: warning: unused variable ‘alreadyInSimple’
BulletCollision/BroadphaseCollision/btOverlappingPairCache.h: In constructor ‘btSortedOverlappingPairCache::btSortedOverlappingPairCache()’:
BulletCollision/BroadphaseCollision/btOverlappingPairCache.h:278: warning: ‘btSortedOverlappingPairCache::m_overlapFilterCallback’ will be initialized after
BulletCollision/BroadphaseCollision/btOverlappingPairCache.h:272: warning:   ‘bool btSortedOverlappingPairCache::m_blockedForChanges’
BulletCollision/BroadphaseCollision/btOverlappingPairCache.cpp:481: warning:   when initialized here
BulletCollision/CollisionShapes/btHeightfieldTerrainShape.h: In constructor ‘btHeightfieldTerrainShape::btHeightfieldTerrainShape(int, int, void*, btScalar, int, bool, bool)’:
BulletCollision/CollisionShapes/btHeightfieldTerrainShape.h:33: warning: ‘btHeightfieldTerrainShape::m_length’ will be initialized after
BulletCollision/CollisionShapes/btHeightfieldTerrainShape.h:31: warning:   ‘btScalar btHeightfieldTerrainShape::m_maxHeight’
BulletCollision/CollisionShapes/btHeightfieldTerrainShape.cpp:21: warning:   when initialized here
./LinearMath/btAlignedObjectArray.h: In member function ‘virtual void btOptimizedBvh::build(btStridingMeshInterface*, bool, const btVector3&, const btVector3&)::NodeTriangleCallback::internalProcessTriangleIndex(btVector3*, int, int)’:
./LinearMath/btAlignedObjectArray.h:213: warning: ‘node.btOptimizedBvhNode::m_padding[4u]’ is used uninitialized in this function
BulletCollision/CollisionShapes/btOptimizedBvh.cpp:57: note: ‘node.btOptimizedBvhNode::m_padding[4u]’ was declared here
./LinearMath/btAlignedObjectArray.h:213: warning: ‘node.btOptimizedBvhNode::m_padding[3u]’ is used uninitialized in this function
BulletCollision/CollisionShapes/btOptimizedBvh.cpp:57: note: ‘node.btOptimizedBvhNode::m_padding[3u]’ was declared here
./LinearMath/btAlignedObjectArray.h:213: warning: ‘node.btOptimizedBvhNode::m_padding[2u]’ is used uninitialized in this function
BulletCollision/CollisionShapes/btOptimizedBvh.cpp:57: note: ‘node.btOptimizedBvhNode::m_padding[2u]’ was declared here
./LinearMath/btAlignedObjectArray.h:213: warning: ‘node.btOptimizedBvhNode::m_padding[1u]’ is used uninitialized in this function
BulletCollision/CollisionShapes/btOptimizedBvh.cpp:57: note: ‘node.btOptimizedBvhNode::m_padding[1u]’ was declared here
./LinearMath/btAlignedObjectArray.h:213: warning: ‘node.btOptimizedBvhNode::m_padding[0u]’ is used uninitialized in this function
BulletCollision/CollisionShapes/btOptimizedBvh.cpp:57: note: ‘node.btOptimizedBvhNode::m_padding[0u]’ was declared here
./LinearMath/btAlignedObjectArray.h: In constructor ‘btTriangleIndexVertexArray::btTriangleIndexVertexArray(int, int*, int, int, btScalar*, int)’:
./LinearMath/btAlignedObjectArray.h:213: warning: ‘mesh.btIndexedMesh::pad’ may be used uninitialized in this function
BulletCollision/CollisionShapes/btTriangleIndexVertexArray.cpp:20: note: ‘mesh.btIndexedMesh::pad’ was declared here
./LinearMath/btAlignedObjectArray.h:213: warning: ‘mesh.btIndexedMesh::m_indexType’ may be used uninitialized in this function
BulletCollision/CollisionShapes/btTriangleIndexVertexArray.cpp:20: note: ‘mesh.btIndexedMesh::m_indexType’ was declared here
./LinearMath/btAlignedObjectArray.h: In constructor ‘btTriangleIndexVertexArray::btTriangleIndexVertexArray(int, int*, int, int, btScalar*, int)’:
./LinearMath/btAlignedObjectArray.h:213: warning: ‘mesh.btIndexedMesh::pad’ may be used uninitialized in this function
BulletCollision/CollisionShapes/btTriangleIndexVertexArray.cpp:20: note: ‘mesh.btIndexedMesh::pad’ was declared here
./LinearMath/btAlignedObjectArray.h:213: warning: ‘mesh.btIndexedMesh::m_indexType’ may be used uninitialized in this function
BulletCollision/CollisionShapes/btTriangleIndexVertexArray.cpp:20: note: ‘mesh.btIndexedMesh::m_indexType’ was declared here
./LinearMath/btAlignedObjectArray.h: In constructor ‘btTriangleMesh::btTriangleMesh(bool, bool)’:
./LinearMath/btAlignedObjectArray.h:213: warning: ‘meshIndex.btIndexedMesh::pad’ may be used uninitialized in this function
BulletCollision/CollisionShapes/btTriangleMesh.cpp:24: note: ‘meshIndex.btIndexedMesh::pad’ was declared here
./LinearMath/btAlignedObjectArray.h: In constructor ‘btTriangleMesh::btTriangleMesh(bool, bool)’:
./LinearMath/btAlignedObjectArray.h:213: warning: ‘meshIndex.btIndexedMesh::pad’ may be used uninitialized in this function
BulletCollision/CollisionShapes/btTriangleMesh.cpp:24: note: ‘meshIndex.btIndexedMesh::pad’ was declared here
BulletCollision/NarrowPhaseCollision/btGjkEpa2.cpp: In member function ‘gjkepa2_impl::GJK::eStatus::_ gjkepa2_impl::GJK::Evaluate(const gjkepa2_impl::tShape&, const btVector3&)’:
BulletCollision/NarrowPhaseCollision/btGjkEpa2.cpp:233: warning: enumeration value ‘Failed’ not handled in switch
BulletCollision/NarrowPhaseCollision/btGjkEpa2.cpp: In static member function ‘static bool btGjkEpaSolver2::Penetration(const btConvexShape*, const btTransform&, const btConvexShape*, const btTransform&, const btVector3&, btGjkEpaSolver2::sResults&)’:
BulletCollision/NarrowPhaseCollision/btGjkEpa2.cpp:848: warning: enumeration value ‘Valid’ not handled in switch
BulletCollision/NarrowPhaseCollision/btGjkEpa2.cpp: In static member function ‘static btScalar gjkepa2_impl::GJK::projectorigin(const btVector3&, const btVector3&, const btVector3&, btScalar*, gjkepa2_impl::U&)’:
BulletCollision/NarrowPhaseCollision/btGjkEpa2.cpp:357: warning: ‘subm’ may be used uninitialized in this function
BulletCollision/NarrowPhaseCollision/btGjkEpa2.cpp: In static member function ‘static btScalar gjkepa2_impl::GJK::projectorigin(const btVector3&, const btVector3&, const btVector3&, const btVector3&, btScalar*, gjkepa2_impl::U&)’:
BulletCollision/NarrowPhaseCollision/btGjkEpa2.cpp:357: warning: ‘subm’ may be used uninitialized in this function
BulletCollision/NarrowPhaseCollision/btGjkEpa2.cpp:357: note: ‘subm’ was declared here
BulletCollision/NarrowPhaseCollision/btGjkEpa2.cpp:404: warning: ‘subm’ may be used uninitialized in this function
BulletCollision/NarrowPhaseCollision/btGjkEpa2.cpp: In member function ‘gjkepa2_impl::GJK::eStatus::_ gjkepa2_impl::GJK::Evaluate(const gjkepa2_impl::tShape&, const btVector3&)’:
BulletCollision/NarrowPhaseCollision/btGjkEpa2.cpp:357: warning: ‘subm’ may be used uninitialized in this function
BulletCollision/NarrowPhaseCollision/btGjkEpa2.cpp:357: note: ‘subm’ was declared here
BulletCollision/NarrowPhaseCollision/btGjkEpa2.cpp:404: warning: ‘subm’ may be used uninitialized in this function
BulletCollision/NarrowPhaseCollision/btGjkEpa2.cpp:404: note: ‘subm’ was declared here
BulletCollision/NarrowPhaseCollision/btGjkEpa2.cpp:357: warning: ‘subm’ may be used uninitialized in this function
BulletCollision/NarrowPhaseCollision/btGjkEpa2.cpp:357: note: ‘subm’ was declared here
BulletDynamics/ConstraintSolver/btConeTwistConstraint.cpp: In member function ‘virtual void btConeTwistConstraint::buildJacobian()’:
BulletDynamics/ConstraintSolver/btConeTwistConstraint.cpp:109: warning: ‘b1Axis2.btVector3::<anonymous>.btQuadWord::<anonymous>.btQuadWordStorage::m_x’ may be used uninitialized in this function
BulletDynamics/ConstraintSolver/btConeTwistConstraint.cpp:109: warning: ‘b1Axis2.btVector3::<anonymous>.btQuadWord::<anonymous>.btQuadWordStorage::m_y’ may be used uninitialized in this function
BulletDynamics/ConstraintSolver/btConeTwistConstraint.cpp:109: warning: ‘b1Axis2.btVector3::<anonymous>.btQuadWord::<anonymous>.btQuadWordStorage::m_z’ may be used uninitialized in this function
BulletDynamics/ConstraintSolver/btConeTwistConstraint.cpp:109: warning: ‘b1Axis3.btVector3::<anonymous>.btQuadWord::<anonymous>.btQuadWordStorage::m_x’ may be used uninitialized in this function
BulletDynamics/ConstraintSolver/btConeTwistConstraint.cpp:109: warning: ‘b1Axis3.btVector3::<anonymous>.btQuadWord::<anonymous>.btQuadWordStorage::m_y’ may be used uninitialized in this function
BulletDynamics/ConstraintSolver/btConeTwistConstraint.cpp:109: warning: ‘b1Axis3.btVector3::<anonymous>.btQuadWord::<anonymous>.btQuadWordStorage::m_z’ may be used uninitialized in this function
BulletDynamics/ConstraintSolver/btSequentialImpulseConstraintSolver.cpp: In member function ‘btScalar btSequentialImpulseConstraintSolver::solveGroupCacheFriendlySetup(btCollisionObject**, int, btPersistentManifold**, int, btTypedConstraint**, int, const btContactSolverInfo&, btIDebugDraw*, btStackAlloc*)’:
BulletDynamics/ConstraintSolver/btSequentialImpulseConstraintSolver.cpp:491: warning: unused variable ‘minReservation’
packet.c:95: warning: function declaration isn’t a prototype
protocol.c: In function ‘enet_protocol_dispatch_incoming_commands’:
protocol.c:47: warning: enumeration value ‘ENET_PEER_STATE_DISCONNECTED’ not handled in switch
protocol.c:47: warning: enumeration value ‘ENET_PEER_STATE_CONNECTING’ not handled in switch
protocol.c:47: warning: enumeration value ‘ENET_PEER_STATE_ACKNOWLEDGING_CONNECT’ not handled in switch
protocol.c:47: warning: enumeration value ‘ENET_PEER_STATE_CONNECTED’ not handled in switch
protocol.c:47: warning: enumeration value ‘ENET_PEER_STATE_DISCONNECT_LATER’ not handled in switch
protocol.c:47: warning: enumeration value ‘ENET_PEER_STATE_DISCONNECTING’ not handled in switch
protocol.c:47: warning: enumeration value ‘ENET_PEER_STATE_ACKNOWLEDGING_DISCONNECT’ not handled in switch
protocol.c: In function ‘enet_protocol_handle_acknowledge’:
protocol.c:709: warning: enumeration value ‘ENET_PEER_STATE_DISCONNECTED’ not handled in switch
protocol.c:709: warning: enumeration value ‘ENET_PEER_STATE_CONNECTING’ not handled in switch
protocol.c:709: warning: enumeration value ‘ENET_PEER_STATE_CONNECTION_PENDING’ not handled in switch
protocol.c:709: warning: enumeration value ‘ENET_PEER_STATE_CONNECTION_SUCCEEDED’ not handled in switch
protocol.c:709: warning: enumeration value ‘ENET_PEER_STATE_CONNECTED’ not handled in switch
protocol.c:709: warning: enumeration value ‘ENET_PEER_STATE_ACKNOWLEDGING_DISCONNECT’ not handled in switch
protocol.c:709: warning: enumeration value ‘ENET_PEER_STATE_ZOMBIE’ not handled in switch
config/device_config.cpp: In member function ‘bool DeviceConfig::getAction(Input::InputType, int, int, PlayerAction*)’:
config/device_config.cpp:67: warning: suggest parentheses around && within ||
/usr/include/irrlicht/S3DVertex.h: In member function ‘irr::scene::IMesh* IrrDriver::createTexturedQuadMesh(const irr::video::SMaterial*, double, double)’:
/usr/include/irrlicht/S3DVertex.h:43: warning: ‘v1.irr::video::S3DVertex::Color.irr::video::SColor::color’ may be used uninitialized in this function
graphics/irr_driver.cpp:533: note: ‘v1.irr::video::S3DVertex::Color.irr::video::SColor::color’ was declared here
/usr/include/irrlicht/S3DVertex.h:43: warning: ‘v2.irr::video::S3DVertex::Color.irr::video::SColor::color’ may be used uninitialized in this function
graphics/irr_driver.cpp:538: note: ‘v2.irr::video::S3DVertex::Color.irr::video::SColor::color’ was declared here
/usr/include/irrlicht/S3DVertex.h:43: warning: ‘v3.irr::video::S3DVertex::Color.irr::video::SColor::color’ may be used uninitialized in this function
graphics/irr_driver.cpp:543: note: ‘v3.irr::video::S3DVertex::Color.irr::video::SColor::color’ was declared here
/usr/include/irrlicht/S3DVertex.h:43: warning: ‘v4.irr::video::S3DVertex::Color.irr::video::SColor::color’ may be used uninitialized in this function
graphics/irr_driver.cpp:548: note: ‘v4.irr::video::S3DVertex::Color.irr::video::SColor::color’ was declared here
graphics/slip_stream.cpp: In member function ‘virtual void SlipStream::update(float)’:
graphics/slip_stream.cpp:200: warning: unused variable ‘weight_old’
graphics/slip_stream.cpp:201: warning: unused variable ‘new_rotation’
karts/kart_properties.cpp: In member function ‘void KartProperties::getAllData(const lisp::Lisp*)’:
karts/kart_properties.cpp:355: warning: ‘c.Vec3::<anonymous>.btVector3::<anonymous>.btQuadWord::<anonymous>.btQuadWordStorage::m_x’ may be used uninitialized in this function
karts/kart_properties.cpp:355: warning: ‘c.Vec3::<anonymous>.btVector3::<anonymous>.btQuadWord::<anonymous>.btQuadWordStorage::m_y’ may be used uninitialized in this function
karts/kart_properties.cpp:355: warning: ‘c.Vec3::<anonymous>.btVector3::<anonymous>.btQuadWord::<anonymous>.btQuadWordStorage::m_z’ may be used uninitialized in this function
physics/btKart.cpp: In member function ‘virtual void btKart::updateFriction(btScalar)’:
physics/btKart.cpp:668: warning: unused variable ‘sideFactor’
physics/btKart.cpp:669: warning: unused variable ‘fwdFactor’
states_screens/dialogs/gp_info_dialog.cpp: In constructor ‘GPInfoDialog::GPInfoDialog(const std::string&, float, float)’:
states_screens/dialogs/gp_info_dialog.cpp:42: warning: unused variable ‘y2’
tracks/bezier_curve.cpp: In member function ‘Vec3 BezierCurve::getHPR(float) const’:
tracks/bezier_curve.cpp:59: warning: ‘hpr.Vec3::<anonymous>.btVector3::<anonymous>.btQuadWord::<anonymous>.btQuadWordStorage::m_unusedW’ is used uninitialized in this function
tracks/bezier_curve.cpp:59: warning: ‘hpr.Vec3::<anonymous>.btVector3::<anonymous>.btQuadWord::<anonymous>.btQuadWordStorage::m_z’ is used uninitialized in this function
tracks/bezier_curve.cpp:59: warning: ‘hpr.Vec3::<anonymous>.btVector3::<anonymous>.btQuadWord::<anonymous>.btQuadWordStorage::m_y’ is used uninitialized in this function
tracks/bezier_curve.cpp:59: warning: ‘hpr.Vec3::<anonymous>.btVector3::<anonymous>.btQuadWord::<anonymous>.btQuadWordStorage::m_x’ is used uninitialized in this function

gcc --version
{l Code}: {l Select All Code}
gcc (Debian 4.3.4-6) 4.3.4
Copyright (C) 2008 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

{l Code}: {l Select All Code}
declare -x CC="ccache gcc"
declare -x CXX="ccache g++"
declare -x CXXFLAGS="-g -O0"

If you need mor information, just let me know it. :)

BTW: The above environment variables results in such compiler lines:
{l Code}: {l Select All Code}
ccache g++ -DPACKAGE_NAME=\"supertuxkart\" -DPACKAGE_TARNAME=\"supertuxkart\" -DPACKAGE_VERSION=\"SVN\" -DPACKAGE_STRING=\"supertuxkart\ SVN\" -DPACKAGE_BUGREPORT=\"\" -DPACKAGE_URL=\"\" -DPACKAGE=\"supertuxkart\" -DVERSION=\"SVN\" -DSTDC_HEADERS=1 -DHAVE_SYS_TYPES_H=1 -DHAVE_SYS_STAT_H=1 -DHAVE_STDLIB_H=1 -DHAVE_STRING_H=1 -DHAVE_MEMORY_H=1 -DHAVE_STRINGS_H=1 -DHAVE_INTTYPES_H=1 -DHAVE_STDINT_H=1 -DHAVE_UNISTD_H=1 -DDEBUG=/\*\*/ -DHAVE_AL_AL_H=1 -DHAVE_OGGVORBIS=1 -DSVNVERSION=\"4698\" -DHAVE_GL_GLUT_H=1 -DHAVE_GLUT=1 -DBT_NO_PROFILE=/\*\*/ -DHAS_GETHOSTBYADDR_R=1 -DHAS_GETHOSTBYNAME_R=1 -DHAS_POLL=1 -DHAS_FCNTL=1 -DHAS_INET_PTON=1 -DHAS_INET_NTOP=1 -DHAS_MSGHDR_FLAGS=1 -DHAS_SOCKLEN_T=1 -DENABLE_NLS=1 -DHAVE_GETTEXT=1 -DHAVE_DCGETTEXT=1 -I.  -DSUPERTUXKART_DATADIR="\"/opt/share/games/supertuxkart/\"" -I./bullet/src/ -I./enet/include/ -I/usr/local/include -I /usr/include/irrlicht  -g -O0 -Wall -g -pg -O2 -MT translation.o -MD -MP -MF .deps/translation.Tpo -c -o translation.o `test -f 'utils/translation.cpp' || echo './'`utils/translation.cpp

As you can see -O2 and -O0 are present. Maybe some auto-detect/indepth-analysis functionality of CXXFLAGS can be added to ./configure and upstreamed to the GNU project?

Happy racing! :D

Q
Quix0r
 
Posts: 4
Joined: 13 Feb 2010, 01:53

Re: SVN 4699 + gcc-4.3 = warnings :-)

Postby Auria » 13 Feb 2010, 03:52

Hi,

I also get these warnings; however, I think they are harmless.
Also, many of these are not in our code, but in bullet or in enet, so we may not know how/want to change these. I'd usually say it's necessary to report these warnings to the bullet author, but STK does not use the latest version of bullet, so they might already be fixed in bullet's latest release
Image
User avatar
Auria
STK Moderator
 
Posts: 2976
Joined: 07 Dec 2009, 03:52

Who is online

Users browsing this forum: No registered users and 1 guest