|
From: Robert C. <r.c...@gs...> - 2007-10-16 12:47:39
|
Christoph Bartoschek wrote: > Am Dienstag, 16. Oktober 2007 schrieb Robert Cussons: > >> readInteractionfromFile reads lines from the file and stores them into >> elements in the structure Inf, if the file is not in the expected >> format, readInteractionfromFile outputs a message and returns a non-zero >> value, causing the if to be entered and the routine to exit. So inside >> the function, Inf is initialised, but it seems that valgrind doesn't >> check for that, it just sees the if, sees Inf, which is not initialised >> until you descend into the function, which is of course done before the >> if condition is evaluated. and gives the warning: >> >> Conditional jump or move depends on uninitialised value(s) > > I am not convinced that this is a valgrind error. Most of the time people > interpret the valgrind result wrongly. This is obviously more than possible, I am very new to valgrind so I may well not be understanding it's messages correctly. > To clarify the situation you should > provide a compilable small testcase that shows the problem. I am attempting to do this at the moment using another function that gave the same error as the one I mentioned, it seems to come up with no complaints from Valgrind (which makes it even less likely it's a shortcoming of valgrind), so I'll keep adding to it to make it more and more similar and see if I can isolate what's causing the valgrind complaints in the other case. > If this is not > possible you might do the following: > > 1. Ensure that you are compiling with debug symbols enabled and without > optimization. compiling without optimisation and with debug information turned on if that's what you mean by debug symbols enabled (from gcc manual): -g Produce debugging information in the operating system’s native format -O0 no optimisation Thanks for the help, Rob. |