On Thu, May 14, 2009 at 6:36 AM, Tom Hughes <[email protected]> wrote:
> David L wrote:
>
>> ==3121== Conditional jump or move depends on uninitialised value(s)
>> ==3121==    at 0x804852F: main (main.cpp:11)
>> ==3121==  Uninitialised value was created by a heap allocation
>> ==3121==    at 0x400674E: operator new(unsigned int)
>> (vg_replace_malloc.c:224)
>> ==3121==    by 0x8048510: main (main.cpp:9)
>> d equals zero.
>> myclass size is 2
>
> What is printing that last line? The code you gave has nothing in it that
> would print that?

oops... I was trying to simplify the example that I posted, so I removed
that printf from the example code, but I forgot to remove it from the
output.  Here's the actual code:

#include <stdio.h>

class MyClass {
public:
  short int foo_ : 6;
};

int main(int argc, char *argv[]) {
  MyClass *gce = new MyClass();
  double d=0.0;
  if (d == 0.0) {
    printf("d equals zero.\n");
    printf("myclass size is %d\n", sizeof(MyClass));
  }
  return 0;
}

------------------------------------------------------------------------------
The NEW KODAK i700 Series Scanners deliver under ANY circumstances! Your
production scanning environment may not be a perfect world - but thanks to
Kodak, there's a perfect scanner to get the job done! With the NEW KODAK i700
Series Scanner you'll get full speed at 300 dpi even with all image 
processing features enabled. http://p.sf.net/sfu/kodak-com
_______________________________________________
Valgrind-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/valgrind-users

Reply via email to