Note that there are some explanatory texts on larger screens.

plurals
  1. POShould I worry about "Conditional jump or move depends on uninitialised value(s)"?
    primarykey
    data
    text
    <p>If you've used Memcheck (from Valgrind) you'll probably be familiar with this message...</p> <blockquote> <p>Conditional jump or move depends on uninitialized value(s)</p> </blockquote> <p><s>I've read about this and it simply occurs when you use an uninitialized value.</p> <pre><code>MyClass s; s.DoStuff(); </code></pre> <p>This will work because <code>s</code> is automatically initialized... So if this is the case, and it works, why does Memcheck tell me that it's uninitialized? Should the message be ignored?</s></p> <p>Perhaps I misunderstood where the error was directing me. From the Valgrind manual, the actual erroneous snippet is...</p> <pre><code>int main() { int x; printf ("x = %d\n", x); } </code></pre> <p>However, in my code, I can't see anything like that. I have noticed however that the function at the top of the stack trace Memcheck shows me is a virtual function; could this be something to do with it?</p> <pre><code>==14446== Conditional jump or move depends on uninitialised value(s) ==14446== at 0x414164: vimrid::glut::GlutApplication::FinishRender() (GlutApplication.cpp:120) ==14446== by 0x422434: vimrid::demos::filterdemos::FilterDemo3::Render() (FilterDemo3.cpp:260) ==14446== by 0x412D3D: vimrid::VimridApplication::UpdateAndRender() (VimridApplication.cpp:93) ==14446== by 0x4144BA: vimrid::glut::GlutApplication::glutHandleDisplay() (GlutApplication.cpp:201) ==14446== by 0x41486A: vimrid::glut::GlutApplication::glutCallbackDisplay() (GlutApplication.cpp:277) ==14446== by 0x54D9FAA: (within /usr/lib64/libglut.so.3.8.0) ==14446== by 0x54DDA4A: fgEnumWindows (in /usr/lib64/libglut.so.3.8.0) ==14446== by 0x54DA4A3: glutMainLoopEvent (in /usr/lib64/libglut.so.3.8.0) ==14446== by 0x54DAEB5: glutMainLoop (in /usr/lib64/libglut.so.3.8.0) ==14446== by 0x413FF8: vimrid::glut::GlutApplication::Run() (GlutApplication.cpp:112) ==14446== by 0x41249D: vimrid::Launcher::runDemo(vimrid::VimridSettings&amp;) (Launcher.cpp:150) ==14446== by 0x412767: vimrid::Launcher::Launch(int, char**) (Launcher.cpp:62) </code></pre> <h3>Update 1:</h3> <p>I took a look at GlutApplication.cpp:120, and it looks like the uninitialized variable was being passed in to a function on that line. Simple!</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload