Home » U++ Library support » U++ Library : Other (not classified elsewhere) » Uninitialized class members.
Re: Uninitialized class members. [message #15738 is a reply to message #15735] |
Tue, 06 May 2008 21:27 |
|
mirek
Messages: 13984 Registered: November 2005
|
Ultimate Member |
|
|
Novo wrote on Tue, 06 May 2008 14:34 |
luzr wrote on Tue, 06 May 2008 13:44 | Not sure what valgrind really tests...
-ScrollBar::ScrollBar() {
+ScrollBar::ScrollBar() :
+style(NULL)
+{
"style" is initialized by SetStyle call in constructor.
|
Valgrind:
==30773== at 0x5A10E3: Upp::ScrollBar::SetStyle(Upp::ScrollBar::Style const&)
==30773== by 0x5DDB88: Upp::ScrollBar::ScrollBar() (in /export/home/ssikorsk/
==30773== by 0x5F4699: Upp::ColumnList::ColumnList() (in /export/home/ssikors
==30773== by 0x5F4A87: Upp::FileList::FileList() (in /export/home/ssikorsk/dv
==30773== by 0x44A7D3: WorkspaceWork::WorkspaceWork() (in /export/home/ssikor
==30773== by 0x45C1DB: Ide::Ide() (in /export/home/ssikorsk/dvlp/upp/svn/upp/
==30773== by 0x482D8C: GuiMainFn_() (in /export/home/ssikorsk/dvlp/upp/svn/up
==30773== by 0x484171: main (in /export/home/ssikorsk/dvlp/upp/svn/upp/out/GC
==30773==
Code:
ScrollBar& ScrollBar::SetStyle(const Style& s)
{
if(style != &s) {
style = &s;
RefreshLayout();
Refresh();
}
return *this;
}
That "if(style != &s)" looks very suspicious to me ...
Quote: |
-TreeCtrl::TreeCtrl()
+TreeCtrl::TreeCtrl() :
+ selectcount(0)
"selectcount" is initialized by Clear call in constructor.
|
Valgrind:
==31285== at 0x672D10: Upp::TreeCtrl::Dirty(int) (in /export/home/ssikorsk/dv
==31285== by 0x67545A: Upp::TreeCtrl::Clear() (in /export/home/ssikorsk/dvlp/
==31285== by 0x6756A8: Upp::TreeCtrl::TreeCtrl() (in /export/home/ssikorsk/dv
==31285== by 0x6142BF: Upp::HelpWindow::HelpWindow() (in /export/home/ssikors
==31285== by 0x42EE02: TopicCtrl::TopicCtrl() (in /export/home/ssikorsk/dvlp/
==31285== by 0x45C91F: Ide::Ide() (in /export/home/ssikorsk/dvlp/upp/svn/upp/
==31285== by 0x482D8C: GuiMainFn_() (in /export/home/ssikorsk/dvlp/upp/svn/up
==31285== by 0x484171: main (in /export/home/ssikorsk/dvlp/upp/svn/upp/out/GC
==31285==
Code:
void TreeCtrl::Clear()
{
item.Clear();
item.Add();
item[0].linei = -1;
item[0].parent = -1;
item[0].canopen = true;
freelist = -1;
Dirty();
cursor = anchor = -1;
selectcount = 0;
}
Dirty() is called before initialization of select count.
Quote: |
Stopped there.... Finding them in .diff is too time consuming, maybe you could just post me the list of problems instead of .diff?
|
I can post either diff or results of valgrind processing, which you can produce yourself ...
Quote: |
P.S.: Do not get me wrong, valgrind is perhaps a good idea! But looks like it produces some false alarms too...
|
As you can see from examples above, valgrind is not giving false alarms.
|
OK, thanks for clarification, you are right (and I am wrong, once again
Mirek
|
|
|
|
|
Uninitialized class members.
By: Novo on Tue, 06 May 2008 17:31
|
|
|
Re: Uninitialized class members.
By: mirek on Tue, 06 May 2008 19:44
|
|
|
Re: Uninitialized class members.
By: Novo on Tue, 06 May 2008 20:34
|
|
|
Re: Uninitialized class members.
By: mirek on Tue, 06 May 2008 21:27
|
|
|
Re: Uninitialized class members.
By: mirek on Tue, 06 May 2008 21:30
|
|
|
Re: Uninitialized class members.
By: mirek on Tue, 06 May 2008 21:36
|
|
|
Re: Uninitialized class members.
By: mirek on Tue, 06 May 2008 21:42
|
|
|
Re: Uninitialized class members.
By: Novo on Tue, 06 May 2008 21:50
|
|
|
Re: Uninitialized class members.
|
|
|
Re: Uninitialized class members.
By: Novo on Wed, 07 May 2008 04:10
|
|
|
Re: Uninitialized class members.
By: mirek on Wed, 07 May 2008 09:57
|
|
|
Re: Uninitialized class members.
|
|
|
Re: Uninitialized class members.
By: mirek on Wed, 07 May 2008 16:32
|
|
|
Re: Uninitialized class members.
By: Novo on Wed, 07 May 2008 17:38
|
|
|
Re: Uninitialized class members.
|
|
|
Re: Uninitialized class members.
By: Novo on Thu, 08 May 2008 00:21
|
|
|
Re: Uninitialized class members.
By: Novo on Wed, 07 May 2008 17:40
|
|
|
Re: Uninitialized class members.
By: cocob on Wed, 07 May 2008 17:55
|
|
|
Re: Uninitialized class members.
By: Novo on Wed, 07 May 2008 19:51
|
|
|
Re: Uninitialized class members.
By: mirek on Wed, 07 May 2008 22:47
|
|
|
Re: Uninitialized class members.
By: Novo on Wed, 07 May 2008 23:05
|
|
|
Re: Uninitialized class members.
By: mirek on Thu, 08 May 2008 01:00
|
|
|
Re: Uninitialized class members.
By: Novo on Thu, 08 May 2008 05:37
|
|
|
Re: Uninitialized class members.
By: mirek on Thu, 08 May 2008 08:00
|
|
|
Re: Uninitialized class members.
By: Novo on Fri, 09 May 2008 04:37
|
|
|
Re: Uninitialized class members.
By: mirek on Sun, 11 May 2008 18:01
|
|
|
Re: Uninitialized class members.
By: Novo on Sun, 11 May 2008 20:43
|
|
|
Re: Uninitialized class members.
By: mirek on Sun, 11 May 2008 22:56
|
|
|
Re: Uninitialized class members.
|
|
|
Re: Uninitialized class members.
By: Novo on Mon, 19 May 2008 23:20
|
|
|
Re: Uninitialized class members.
|
|
|
Re: Uninitialized class members.
By: Novo on Fri, 30 May 2008 06:06
|
Goto Forum:
Current Time: Sun Jun 09 16:49:26 CEST 2024
Total time taken to generate the page: 0.02614 seconds
|