Valgrind has kept complaining about uninitialized bytes and by trimming down in look for a minimal example I have ended up with this:
#include <valgrind/memcheck.h>
struct dummyObject{
int foo;
bool bar;
dummyObject():foo(1),bar(true) {}
};
int main(){
dummyObject dummy;
VALGRIND_CHECK_VALUE_IS_DEFINED(dummy);
return 0;
}
Having two ints or two bools, or a single int or bool, cause no complaints. It looks as if having a class with members of different types leads to Valgrind complaining. This is not simply due to my explicit request for checking either; in a larger program where object similar to dummyObject gets used, I 'm getting the "Conditional jump or move depends on uninitialised value(s)" error.
My compiler is g++ 4.7.3 on a 64-bit linux, compiling with debug flags and no optimizations - or with, it makes no difference.
Is there something I 'm missing, or is it a false positive?