Conditional jump or move depends on uninitialised value(s)

Sep 26, 2016 at 8:04am
Hello everybody,

I am trying to get zero errors in valgrind. Unfortunately, the code is too long to be written here.

I am running my program using

valgrind --leak-check=full --show-leak-kinds=all --track-origins=yes

I am solving the errors from top to bottom and one of the last ones is about Conditional jump or move depends on uninitialised value(s). But, it is very confusing. The if statement
checks if an object attribute is equal to an enum. I used the same thing somewhere else in the code without any valgrind error.

Valgrind gives a line number where the uninitialized variable might be located, but no code is written in that line.

Any comments?

Thanks,
M

Sep 26, 2016 at 8:38am
1. What is on the lines around the pointed line?

2. Is the object attribute initialized? Is the object initialized?
Sep 26, 2016 at 8:58am
The are a few variables around the line all of which are initialized.
The object attribute and the object are also initialized. The get function returns the value of the attribute, then I am checking if the returned value of the get function is equal to an enum.
Sep 26, 2016 at 10:53am
Is there also a:
Uninitialised value was created by 

after the "Conditional jump or move" message?
Sep 26, 2016 at 10:54am
Yes.
Sep 26, 2016 at 11:07am
Uninitialised value was created by a stack allocation
Sep 26, 2016 at 11:25am
Were the following lines the ones that point to that empty line in the code?
Sep 26, 2016 at 11:28am
Yes.
Topic archived. No new replies allowed.