|
From: Bill T. <Bil...@ny...> - 2007-05-24 16:06:15
|
It appears that valgrind does not detect uninitialised values in boolean expressions. I recently came across a problem with code similar to: int x; // uninit bool y =3D (x =3D=3D 0); // uninit value not flagged The value of "y" was correctly flagged as uninitialised at assignment time and its use detected later in the program, but the use of the uninitialised value of x was not. I assume that the reason the original expression did not raise a warning is that the compiler generated code to compute the boolean expression that did not use a condititional jump. Does this sound right? Are there other similar constructs that valgrind is unable to flag, or does it depend on the code generated by the compiler? Any workarounds? TIA. |