Mailinglist Archive: opensuse-programming (31 mails)

< Previous Next >
Re: [opensuse-programming] What's the best way to cure uninitialized variables?
  • From: Per Jessen <per@xxxxxxxxxxxx>
  • Date: Thu, 13 Aug 2009 12:36:36 +0200
  • Message-id: <h60qbk$2n4$2@xxxxxxxxxxxxxxxx>
Dave Plater wrote:

On 08/08/2009 0
I'm still stuck on :-
In member function 'virtual void
btOptimizedBvh::build(btStridingMeshInterface*, bool, const
btVector3&, const

int, int)':
warning: 'node.btOptimizedBvhNode::m_padding[4u]' is used
uninitialized in this function

Hmm, I think I know what's going on:

the templated class btAlignedObjectArray has a method push_back(), which
in line 224 uses new() in-place to initialize with the contents of
argument _Val. I'm guessing that _Val is of type btOptimizedBvhNode,
the struct with m_padding[5]. To copy from _Val to the new object,
m_padding will also be read, but since it hasn't been initialized ...

Try this in


line 97: instead of "int m_padding[5]" :

"int :5*8*sizeof(int)"

I think that compiles, but does give a warning about the width of
anynomous being wider than the type. If that causes a problem,

try this instead:

"int :sizeof(int)"
"int :sizeof(int)"
"int :sizeof(int)"
"int :sizeof(int)"
"int :sizeof(int)"

/Per Jessen, Z├╝rich

To unsubscribe, e-mail: opensuse-programming+unsubscribe@xxxxxxxxxxxx
For additional commands, e-mail: opensuse-programming+help@xxxxxxxxxxxx

< Previous Next >