3 ms·
Unfortunately, most CPU's aren't Valgrind. You have to port your code to GNU/Linux user space to take advantage of Valgrind. (Evidently, Solaris and Darwin are
by kazinator 8y ago
Unfortunately, most CPU's aren't Valgrind. You have to port your code to GNU/Linux user space to take advantage of Valgrind. (Evidently, Solaris and Darwin are supported now, as well as Android.)
By the way, Valgrind has an API, using which variables that have been reliably cleared to zero can be marked as de facto uninitialized.
However, in this situation, it requires integration of use of the Valgrind API into the compiler, which has to generate code on function entry points to not only clear the locals, but do the Valgrind API call to mark the memory.
But then this will of course yield false positives from Valgrind when programs rely semantically on the initialization for correctness and not just to have predictable behavior for a forgotten initialization.
- saagarjha 8y ago> Evidently, Solaris and Darwin are supported now, as well as Android. Not the latest version, though; support is still only offered for macOS Sierra.