According to the manual it doesn't:
It is important to understand that your program can copy around junk (uninitialised) data as much as it likes. Memcheck observes this and keeps track of the data, but does not complain. A complaint is issued only when your program attempts to make use of uninitialised data in a way that might affect your program's externally-visible behaviour.
The question is if there's some important reason to behave this way? Is there a (commonly) used construct that's copies uninitialized data that would trigger false positives? Or is there a way to make valgrind complain about this?
My concern was that in C the use of uninitialized variables have undefined behavior (IIRC), so for example the following functions could emit nasal daemons:
int fubar(void) {
int a;
return a;
}
now I recalled incorrectly, it's only in certain situations it's undefined, for example if you're doing arithmetics with uninitialized variables:
int fubar(void) {
int a;
a -= a;
return a;
}
So the same question arises here. Is there some important reason for valgrind to allow arithmetics with uninitialized data? etc. Note that especially if it were floating point data it could actually alter externally observable behaviour as trapping on FP-errors might be enabled.