Mailinglist Archive: opensuse-programming (31 mails)

< Previous Next >
Re: [opensuse-programming] What's the best way to cure uninitialized variables?
  • From: Dave Plater <dave.plater@xxxxxxxxxxx>
  • Date: Thu, 13 Aug 2009 10:26:59 +0200
  • Message-id: <4A83CE53.3080309@xxxxxxxxxxx>
On 08/08/2009 04:56 PM, Per Jessen wrote:
Dave Plater wrote:


Thanks Philipp, I will try that but it seems Per's solution works on
the stable blender-2.49, it's completed building with only the last
unitialized variable left to sort out :-
W: blender uninitialized-variable
extern/bullet2/src/LinearMath/btAlignedObjectArray.h:224


This is a wild guess: in line 224, try this:

new ( &m_data[size()] ) T(_Val);


/Per Jessen, Z├╝rich


I'm still stuck on :-
/home/davepl/src/blender-2.49/extern/bullet2/src/LinearMath/btAlignedObjectArray.h:
In member function 'virtual void
btOptimizedBvh::build(btStridingMeshInterface*, bool, const btVector3&,
const
btVector3&)::NodeTriangleCallback::internalProcessTriangleIndex(btVector3*,
int, int)':
/home/davepl/src/blender-2.49/extern/bullet2/src/LinearMath/btAlignedObjectArray.h:224:
warning: 'node.btOptimizedBvhNode::m_padding[4u]' is used uninitialized
in this function
/home/davepl/src/blender-2.49/extern/bullet2/src/BulletCollision/CollisionShapes/btOptimizedBvh.cpp:56:
note: 'node.btOptimizedBvhNode::m_padding[4u]' was declared here
/home/davepl/src/blender-2.49/extern/bullet2/src/LinearMath/btAlignedObjectArray.h:224:
warning: 'node.btOptimizedBvhNode::m_padding[3u]' is used uninitialized
in this function
/home/davepl/src/blender-2.49/extern/bullet2/src/BulletCollision/CollisionShapes/btOptimizedBvh.cpp:56:
note: 'node.btOptimizedBvhNode::m_padding[3u]' was declared here
/home/davepl/src/blender-2.49/extern/bullet2/src/LinearMath/btAlignedObjectArray.h:224:
warning: 'node.btOptimizedBvhNode::m_padding[2u]' is used uninitialized
in this function
/home/davepl/src/blender-2.49/extern/bullet2/src/BulletCollision/CollisionShapes/btOptimizedBvh.cpp:56:
note: 'node.btOptimizedBvhNode::m_padding[2u]' was declared here
/home/davepl/src/blender-2.49/extern/bullet2/src/LinearMath/btAlignedObjectArray.h:224:
warning: 'node.btOptimizedBvhNode::m_padding[1u]' is used uninitialized
in this function
/home/davepl/src/blender-2.49/extern/bullet2/src/BulletCollision/CollisionShapes/btOptimizedBvh.cpp:56:
note: 'node.btOptimizedBvhNode::m_padding[1u]' was declared here
/home/davepl/src/blender-2.49/extern/bullet2/src/LinearMath/btAlignedObjectArray.h:224:
warning: 'node.btOptimizedBvhNode::m_padding[0u]' is used uninitialized
in this function
/home/davepl/src/blender-2.49/extern/bullet2/src/BulletCollision/CollisionShapes/btOptimizedBvh.cpp:56:
note: 'node.btOptimizedBvhNode::m_padding[0u]' was declared here

To get the correct uninitialized variable message you need to pass gcc
the following switches:-
* -O2 -Wall -D_FORTIFY_SOURCE=2 -fstack-protector -funwind-tables
-fasynchronous-unwind-tables -fmessage-length=0
Any help appreciated.
Dave P
--
To unsubscribe, e-mail: opensuse-programming+unsubscribe@xxxxxxxxxxxx
For additional commands, e-mail: opensuse-programming+help@xxxxxxxxxxxx

< Previous Next >
Follow Ups