Mailinglist Archive: opensuse-programming (31 mails)

< Previous Next >
Re: [opensuse-programming] What's the best way to cure uninitialized variables?
  • From: Philipp Thomas <pth@xxxxxxx>
  • Date: Thu, 13 Aug 2009 18:51:01 +0200
  • Message-id: <20090813165101.GA22737@xxxxxxxxxxxxxxxx>
* Per Jessen (per@xxxxxxxxxxxx) [20090813 18:23]:

btOptimizedBvhNode is a struct so you can't initialize where it is
defined, only when it is instantiated.

Yes, because a struct doesn't have ctors you can't initialize it where
defined, I know that. What I had in mind was initializing with
memset(xxx,'\0', sizeof(xxx)).

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

After thinking a bit about it, I guess you are right. And calling it hack
wasn't right either, it was just that no other suitable term came to my

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

< Previous Next >
Follow Ups