André Wöbbeking wrote:
> Hi,
>
> I'm using Valgrind 3.4.1 and I wonder why I don't get a warning for the
> std::swap() call in the attached example. I get one in printf(). Is this
> a bug?
>
>
> Cheers,
> André
>
> ------------------------------------------------------------------------
André,
Valgrind only reports when an unused variable is used for flow-control
(or, hopefuly I/O).
Swapping doesn't trigger the alert. This is because, in C, structures
can legitimately have
uninitialised areas due to nested unions or padding.
printf() uses flow-control to decide how many characters to print.
HTH,
Colin S. Miller
|