|
From: Eric E. <eri...@fr...> - 2004-08-18 01:04:33
|
Jeroen N. Witmond wrote:
> ==2241== Conditional jump or move depends on uninitialised value(s)
> ==2241== at 0x804FAB4: main (SimpleExample.cpp:240)
>
> The relevant part of this source file SimpleExample.cpp is:
>
> const unsigned int nFailed = speedy.getRunCount(Executor::Failed);
> if (nFailed == 0) // <== line 240.
...
> This seems to indicate that variable nFailed *is* initialised. The
> corresponding part in the output of gdb command 'disassemble' is:
Looking at the source code, you may think that your variable
is properly initialized in the affectation nFailed = getRunCount(...).
What Valgrind tells you here is that the value returned by getRunCount()
is likely to be completely random, since it has not been initialized.
e.g. (the most simple case) :
int zz::getRunCount()
{
int k;
[ code which does not initialize k ]
return k;
}
Cheers
--
Eric
|