|
From: <eyu...@ab...> - 2008-12-15 10:43:28
|
Hello,
I have read the FAQ and searched the mailing lists (or tried to, there
were 100s of related posts) about this but...
The FAQ says:
--------------------------------------------------
As for eager reporting of copies of uninitialised memory values, this
has been suggested multiple times. Unfortunately, almost all programs
legitimately copy uninitialised memory values around (because
compilers pad structs to preserve alignment) and eager checking leads
to hundreds of false positives. Therefore Memcheck does not support
eager checking at this time."
--------------------------------------------------
However it is possible to pack the structs without holes...
from gcc manual:
--------------------------------------------------
-fpack-struct[=n]
Without a value specified, pack all structure members together
without holes. When a value is specified (which must be a small power
of two), pack structure members according to this value, representing
the maximum alignment (that is, objects with default alignment
requirements larger than this will be output potentially unaligned at
the next fitting location.
--------------------------------------------------
Would it be possible to introduce an eager checking mechanism which is
enabled by a command line option while running valgrind? or are there
other reasons why this is not done than the one explained in the FAQ?
If there are, what are they?
BTW I also tried the '--track-origins=yes' from the trunk code. It is
quite useful as well, but it might be nicer to be able to see where
the uninitialized variable is used first time (in an assignment etc.)
other than showing errors for only printf etc. type statements. Is
there any practical difficulty for not implementing this feature other
than the one explained at FAQ? am I missing something here?
Thanks,
Evren
|