I'm trying to debug my code using valgrind. Most of the message I get are:
Conditional jump or move depends on uninitialised value(s) or
Invalid read of size 8 I'm mainly concerned about the first, if the value was truly uninitialized I believe segmentation fault would occur. I tested this by sending the same pointer to another function along with uninitialized pointer to a function which I know throws a segmentation fault and only the truly uninitialized pointer has cause a segmentation fault.
What also might be the meaning of this error message.
Also, what does the second error means?
Edit1
Here is a model code, would that give error 1 (assume that the header files are legal)?
a.cpp
B b; C c; int main(){ return 0; } B.cpp
extern C c; // double t; //canceld, declared in the header. B::B(){ this->t = 1; c.test(t); } B::test(){ c.test(this->t); } B.cpp
C::C(){ } C::test(double t){ printf("%f\n",t); }
test()from B's constructor, that would be a problem. Otherwise it sounds more like you have anif (x > 5)wherexdoesn't have a value. That wouldn't segfault.