|
From: <Rom...@cr...> - 2013-01-25 14:47:00
|
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
|