Hi

I have the following code (compiled with g++ 4.4.3):

3: int main()
4: {
5:     char lMsg[256];
6:     sprintf(lMsg, "%i%i%i%i", 1, 2, 3, 4);
7:     printf("%s", lMsg);
8:     return 0;
9: }

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)

I'm fairly new to Valgrind and I can't figure out what's wrong - but it feels 
like I am missing something obvious :) Any ideas?

Thanks in advance
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