From: Nicholas N. <nj...@ca...> - 2003-05-23 17:21:44
|
On Fri, 23 May 2003, Steve G wrote: > I guess this illustrates the problem: > > int main(void) > { > char buf1[20], buf2[20]; > > > memcpy(buf1, buf2, 20); > > puts(buf1); > > > } > > every single byte in buf1 has been written to. Is buf1 > considered uninitialized in the call to puts? Shouldn't the > memcpy actually be the error? Everything I see output from > the simplified program above The V (validity) bits are used to detect if any of the following operations depend on uninitialised values: - conditional tests and moves, - system calls - memory address computations. The V bits are not checked simply when a value is read, because partially defined words are often copied around, due to the common practice of padding structures to ensure fields are word-aligned. It doesn't even complain if you add two uninitialised integers, because that doesn't affect the behaviour of the program (unless the result is used in one of the above three operations, then it complains). N |