Code::Blocks Forums

Developer forums (C::B DEVELOPMENT STRICTLY!) => Development => Topic started by: tomjnx on January 05, 2013, 06:40:46 PM

Title: MouseSap: silence Valgrind
Post by: tomjnx on January 05, 2013, 06:40:46 PM
This trivial patch reduces the number of Valgrind "conditional jump depends on uninitialized value" warnings:

diff --git a/src/plugins/contrib/MouseSap/MouseSap.cpp b/src/plugins/contrib/MouseSap/MouseSap.cpp
index e611f18..dbf3a74 100644
--- a/src/plugins/contrib/MouseSap/MouseSap.cpp
+++ b/src/plugins/contrib/MouseSap/MouseSap.cpp
@@ -64,6 +64,7 @@ MouseSap* MouseSap::pMouseSap;

// ----------------------------------------------------------------------------
MouseSap::MouseSap()
+     : m_pMyLog(0), m_bEditorsAttached(false), m_bMouseSapEnabled(false), m_pMMSapEvents(0)
// ----------------------------------------------------------------------------
{
       //ctor
Title: Re: MouseSap: silence Valgrind
Post by: oBFusCATed on January 05, 2013, 06:42:30 PM
As far as I can see the patch is broken, also please use nullptr instead of 0 for pointers.
Title: Re: MouseSap: silence Valgrind
Post by: tomjnx on January 05, 2013, 06:49:45 PM
Quote from: oBFusCATed on January 05, 2013, 06:42:30 PM
As far as I can see the patch is broken, also please use nullptr instead of 0 for pointers.

Ok, fixed. Also, this patch is probably too trivial to apply it using patch 8-)

diff --git a/src/plugins/contrib/MouseSap/MouseSap.cpp b/src/plugins/contrib/MouseSap/MouseSap.cpp
index e611f18..77bde4d 100644
--- a/src/plugins/contrib/MouseSap/MouseSap.cpp
+++ b/src/plugins/contrib/MouseSap/MouseSap.cpp
@@ -64,6 +64,7 @@ MouseSap* MouseSap::pMouseSap;

// ----------------------------------------------------------------------------
MouseSap::MouseSap()
+     : m_pMyLog(nullptr), m_bEditorsAttached(false), m_bMouseSapEnabled(false), m_pMMSapEvents(nullptr)
// ----------------------------------------------------------------------------
{
        //ctor
Title: Re: MouseSap: silence Valgrind
Post by: oBFusCATed on January 05, 2013, 07:05:54 PM
In SVN...

BTW: How long does it take to ryn cb under valgrind?
Title: Re: MouseSap: silence Valgrind
Post by: tomjnx on January 05, 2013, 07:56:18 PM
Quote from: oBFusCATed on January 05, 2013, 07:05:54 PM
BTW: How long does it take to ryn cb under valgrind?

Thanks a lot!

It takes approximately 90 seconds from invocation to display the main window on an:
Intel(R) Core(TM)2 Duo CPU     E8400  @ 3.00GHz
(with core plugins installed only)

Afterwards, editing is noticeably slower, but bearable for bug hunting...
Title: Re: MouseSap: silence Valgrind
Post by: oBFusCATed on January 05, 2013, 09:14:46 PM
Is this with optimized or debug builds?
Title: Re: MouseSap: silence Valgrind
Post by: tomjnx on January 05, 2013, 11:42:50 PM
With
-O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4  -m64 -mtune=generic
on Linux