|
From: Christoph B. <bar...@or...> - 2007-10-16 11:55:45
|
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. To clarify the situation you should provide a compilable small testcase that shows the problem. If this is not possible you might do the following: 1. Ensure that you are compiling with debug symbols enabled and without optimization. 2. Post the whole valgrind message. The error and the tracebacks. 3. Post the declarations of your structs and the whole code of readInteractionfromFile. Christoph |