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 18:22:39 +0200
  • Message-id: <h61ekf$5qs$1@xxxxxxxxxxxxxxxx>
Philipp Thomas wrote:

* Per Jessen (per@xxxxxxxxxxxx) [20090813 12:37]:

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 ...

And? Where's the problem ? Simply initialize m_padding and the
compiler will stop complaining. No need for the sizeof hack.

Philipp

btOptimizedBvhNode is a struct so you can't initialize where it is
defined, only when it is instantiated. Making the padding anynomous is
much easier (and there's no "hack" in using sizeof() to make sure I get
the right number of bits).


/Per Jessen, Z├╝rich

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

< Previous Next >