Hi all,

I've come across a lot of code at work where an unitialized variable is passed 
around to different variables and only detected at a much later time when it 
actually gets used. Even with track-origin=yes it doesn't tell me exactly where 
the variable is, still have to hunt more. Having noticed that valgrind does 
checks when there is an if statement, I ended doing a lot of this kind of hack 
to find the culprit:

int a; // never initialized


.....

int b = a; if(a) {  int dummy = 1; }


Valgrind will then tell me the exact line where the unitialized variable is 
used, and then I keep going backwards adding more of those if(...) test. Is 
there a better way? I'm hoping there's some option that can tell Valgrind to 
check on assignments for unitialized variables as well.

Nghia
------------------------------------------------------------------------------
LogMeIn Rescue: Anywhere, Anytime Remote support for IT. Free Trial
Remotely access PCs and mobile devices and provide instant support
Improve your efficiency, and focus on delivering more value-add services
Discover what IT Professionals Know. Rescue delivers
http://p.sf.net/sfu/logmein_12329d2d
_______________________________________________
Valgrind-users mailing list
Valgrind-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/valgrind-users

Reply via email to