> I have some queries regarding the log messages generated by
>valgrind when a leak check is performed. I performed a leak-check on
>my program with the following options :
> --leak-check=yes --show-reachable=yes.
> The error message depicted that there are some uninitialized
>variables, the log generated is as follows :
> ==23922== Use of uninitialised value of size 4
> ==23922== Conditional jump or move depends on uninitialised value(s)
> My question is, when are this messages logged by valgrind i.e. what
>errors in the program (which is under test) are this messages logged ?
> I went through my code and found that everything is fine and the
>variables used are initialised properly, so I am wondering what other
>possible errors may lead to these type of message.
Even if you initialize a variable properly, if you later copy an
undefined value into it, it can produce this message. You need to look
at the dataflow of your program to see how an undefined value got where
it did. Including valgrind/memcheck.h and using
VALGRIND_CHECK_DEFINED() will help.