on-internet
← Community

Valgrind is reporting "Use of uninitialised value of size 4" when using strlen

Stack Overflow ·

I'm trying to use Valgrind on Raspberry Pi. I am analyzing the following program: #include <string> #include <cstring> int main() { std::string blaat = "blaat"; const char * buf = blaat.c_str(); size_t l = 0; l = strlen(buf); printf("string size %u\n", l); } Compile: g++ -g -Wall -O0 test.cpp Analyze (valgrind-3.16.1): valgrind --leak-check=yes ./a.out Result: ==29572== ==29572== Conditional jump or move depends on uninitialised value(s) ==29572== at 0x4866210: ??? (in /usr/lib/arm-linux-gnueabihf/libarmmem-v7l.so) ==29572== ==29572== Conditional jump or move depends on uninitialised value(s)

Comments

Sign in or sign up to comment and upvote.

No comments yet.