← Back to team overview

widelands-dev team mailing list archive

[Merge] lp:~hjd/widelands/mark-scan-build-false-positives into lp:widelands

 

Hans Joachim Desserud has proposed merging lp:~hjd/widelands/mark-scan-build-false-positives into lp:widelands.

Requested reviews:
  Widelands Developers (widelands-dev)

For more details, see:
https://code.launchpad.net/~hjd/widelands/mark-scan-build-false-positives/+merge/238794

The scan-build report will include some issues which we have previously closed as false positives. With each scan-build run a new report is produced and currently I need to search Launchpad to check older bug reports to see whether these are new issues or not. By having a comment close to the false positives it is no longer necessary to check the bug tracker since any uncommented issue is new. 
-- 
https://code.launchpad.net/~hjd/widelands/mark-scan-build-false-positives/+merge/238794
Your team Widelands Developers is requested to review the proposed merge of lp:~hjd/widelands/mark-scan-build-false-positives into lp:widelands.
=== modified file 'src/logic/worker.cc'
--- src/logic/worker.cc	2014-09-30 05:41:55 +0000
+++ src/logic/worker.cc	2014-10-18 13:52:41 +0000
@@ -1543,6 +1543,9 @@
 				("MO(%u): [transfer]: from road to bad nextstep %u",
 				 serial(), nextstep->serial());
 	} else
+		//Scan-build reports Called C++ object pointer is null here.
+		//This is a false positive.
+		//See https://bugs.launchpad.net/widelands/+bug/1198918
 		throw wexception
 			("MO(%u): location %u has bad type",
 			 serial(), location->serial());

=== modified file 'src/network/nethost.cc'
--- src/network/nethost.cc	2014-10-11 16:03:18 +0000
+++ src/network/nethost.cc	2014-10-18 13:52:41 +0000
@@ -1984,6 +1984,9 @@
 	// needs the file.
 	s.unsigned_8(NETCMD_NEW_FILE_AVAILABLE);
 	s.string(mapfilename);
+	//Scan-build reports that access to bytes here results in a dereference of null pointer.
+	//This is a false positive.
+	//See https://bugs.launchpad.net/widelands/+bug/1198919
 	s.unsigned_32(file->bytes);
 	s.string(file->md5sum);
 	return true;

=== modified file 'src/ui_basic/box.cc'
--- src/ui_basic/box.cc	2014-06-01 18:00:48 +0000
+++ src/ui_basic/box.cc	2014-10-18 13:52:41 +0000
@@ -202,6 +202,9 @@
 		m_orientation == Horizontal ? get_inner_w() : get_inner_h();
 	for (uint32_t idx = 0; idx < m_items.size(); ++idx)
 		if (m_items[idx].fillspace) {
+			//Scan-build reports this can result in divsion by zero
+			//This is a false positive.
+			//See https://bugs.launchpad.net/widelands/+bug/1044930
 			m_items[idx].assigned_var_depth =
 				(max_depths - totaldepth) / infspace_count;
 			totaldepth += m_items[idx].assigned_var_depth;

=== modified file 'src/ui_basic/panel.cc'
--- src/ui_basic/panel.cc	2014-09-20 09:37:47 +0000
+++ src/ui_basic/panel.cc	2014-10-18 13:52:41 +0000
@@ -153,7 +153,12 @@
 /**
  * Free all of the panel's children.
  */
-void Panel::free_children() {while (_fchild) delete _fchild;}
+void Panel::free_children() {
+	//Scan-build claims this results in double free.
+	//This is a false positive.
+	//See https://bugs.launchpad.net/widelands/+bug/1198928
+	while (_fchild) delete _fchild;
+}
 
 
 /**

=== modified file 'src/ui_basic/radiobutton.cc'
--- src/ui_basic/radiobutton.cc	2014-02-22 18:04:02 +0000
+++ src/ui_basic/radiobutton.cc	2014-10-18 13:52:41 +0000
@@ -86,7 +86,12 @@
 /**
  * Free all associated buttons.
  */
-Radiogroup::~Radiogroup() {while (m_buttons) delete m_buttons;}
+Radiogroup::~Radiogroup() {
+	//Scan-build claims this results in double free.
+	//This is a false positive.
+	//See https://bugs.launchpad.net/widelands/+bug/1198928
+	while (m_buttons) delete m_buttons;
+}
 
 
 /**


Follow ups