From: Leonard m. <spa...@ya...> - 2003-06-10 14:45:35
|
#include <stdio.h> struct stuff { double value; }; int main() { stuff prev,curr; //curr.value = 0; prev = curr; curr.value = 1; if ( prev.value != curr.value ) printf( "Different\n" ); } In the above example, prev = curr doesn't generate a ref to uninit data warning. But the condition on the if line does. Just a curious question. What is valgrind's test for "dealing" with uninitialized data? It appears reading it moving it around is OK, but using it to perform "a computation" is an error? But what is "a computation" in this context? This guess seems consistent with the fact that valgrind doesn't flag passing uninitialized data to a function so long as the parameter isn't used. But I'd like to know the full story. Thanks, Randall __________________________________ Do you Yahoo!? Yahoo! Calendar - Free online calendar with sync to Outlook(TM). http://calendar.yahoo.com |