Overview
Examples
Screenshots
Comparisons
Applications
Download
Documentation
Tutorials
Bazaar
Status & Roadmap
FAQ
Authors & License
Forums
Funding Ultimate++
Search on this site
Search in forums












SourceForge.net Logo
Home » U++ Library support » U++ Library : Other (not classified elsewhere) » Uninitialized class members.
Re: Uninitialized class members. [message #15735 is a reply to message #15728] Tue, 06 May 2008 20:34 Go to previous messageGo to previous message
Novo is currently offline  Novo
Messages: 1358
Registered: December 2006
Ultimate Contributor
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. Wink


Regards,
Novo
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: Display problem with Splitter, GLCtrl and MenuBar
Next Topic: Ide console
Goto Forum:
  


Current Time: Wed May 15 14:40:39 CEST 2024

Total time taken to generate the page: 0.02790 seconds