> > 6:     sprintf(lMsg, "%i%i%i%i", 1, 2, 3, 4);
> > 7:     printf("%s", lMsg);
> >
> > memcheck with Valgrind 3.8.1 complains about:
> >
> > ==28037== Conditional jump or move depends on uninitialised value(s)
> > ==28037==    at 0x41EB419: ??? (in /lib/tls/i686/cmov/libc-2.11.1.so)
> > ==28037==    by 0x41BF2BF: printf (in /lib/tls/i686/cmov/libc-2.11.1.so)
> > ==28037==    by 0x80485B6: main (test.cpp:7)
> > ==28037==  Uninitialised value was created by a stack allocation
> > ==28037==    at 0x804855A: main (test.cpp:4)

> The suspect code is in a subroutine that is called by printf, and is inside 
> libc-
> 2.11.1.so.
> It's probably the equivalent of strlen() applied to "1234", and which uses
> word-wide operations on the terminating "\0???" where the '?' are uninit
> bytes.

That sounds reasonable. If the length of the resulting string is a multiple of 
4 minus 1, Valgrind doesn't complain.

> libc-2.11 is about three years old; 2.17 is current.  The complaint above does
> not arise with 2.17.  Have you considered upgrading?

I'll consider upgrading to a newer libc...

Thanks,
Roman

------------------------------------------------------------------------------
Master Visual Studio, SharePoint, SQL, ASP.NET, C# 2012, HTML5, CSS,
MVC, Windows 8 Apps, JavaScript and much more. Keep your skills current
with LearnDevNow - 3,200 step-by-step video tutorials by Microsoft
MVPs and experts. ON SALE this month only -- learn more at:
http://p.sf.net/sfu/learnnow-d2d
_______________________________________________
Valgrind-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/valgrind-users

Reply via email to