Re: [Valgrind-users] detecting uninitialized values in debug builds

2020-03-03 Thread Ben White
could compare the two asm lang outputs. After that, it was fairly clear that the compiler is not initializing y. Ben -Original Message- From: John Reiser Sent: Monday, March 2, 2020 7:20 PM To: valgrind-users@lists.sourceforge.net Subject: Re: [Valgrind-users] detecting uninitialized

Re: [Valgrind-users] detecting uninitialized values in debug builds

2020-03-03 Thread Dallman, John
> However, I've also been told that the g++ compiler will initialize all stack > objects to zero when compiling for debug (the -g option). Yet, valgrind > still detects the un-init condition. I think whoever told you that was confusing it with Microsoft Visual Studio. The default debug-build c

Re: [Valgrind-users] detecting uninitialized values in debug builds

2020-03-02 Thread John Reiser
On 3/2/20 22:02 UTC, Ben White wrote: I’ve also been told that the g++ compiler will initialize all stack objects to zero when compiling for debug (the -g option). Obviously you didn't try it. g++ 9.2.1 does not do that. $ cat foo.cpp int g(int x, int y); int f(int x) { int y;

[Valgrind-users] detecting uninitialized values in debug builds

2020-03-02 Thread Ben White
Hello, I have seen cases where valgrind (memcheck) will report conditional jump or move based on uninitialized value, and when examining the relevant source code, I can see that the value or variable is indeed uninitialized. However, I've also been told that the g++ compiler will initialize al