Bug#421124: FTBFS with GCC 4.3: missing #includes, extra ;

Martin Michlmayr tbm at cyrius.com
Thu Apr 26 16:11:10 UTC 2007


Package: opencity
Version: 0.0.4stable-1
Usertags: ftbfs-gcc-4.3
Tags: patch

Your package fails to build with GCC 4.3.  Version 4.3 has not been
released yet but I'm building with a snapshot in order to find errors
and give people an advance warning.

Problem 1: in GCC 4.3, the C++ header dependencies have been cleaned
up.  The advantage of this is that programs will compile faster.  The
downside is that you actually need to directly #include everything you
use (but you really should do this anyway, otherwise your program
won't work with any compiler other than GCC).  Some background of this
can be found at http://gcc.gnu.org/PR28080

Problem 2: don't put a semicolon after functions

You can reproduce this problem with gcc-snapshot (20070422-1 or higher)
from unstable. (Currently not available for i386, but for amd64, powerpc
and ia64.  I hope to have i386 binaries in the archive in the near
future.)


> Automatic build of opencity_0.0.4stable-1 on em64t by sbuild/amd64 0.53
...
> if x86_64-linux-gnu-g++ -DHAVE_CONFIG_H -I. -I. -I../..  -I../../src/ -I../../src/structure/   -I/usr/X11R6/include  -DNDEBUG -Wall -ansi -pedantic -fno-exceptions -I/usr/include/SDL -D_GNU_SOURCE=1 -D_REENTRANT -MT kernel.o -MD -MP -MF ".deps/kernel.Tpo" -c -o kernel.o kernel.cpp; \
> 	then mv -f ".deps/kernel.Tpo" ".deps/kernel.Po"; else rm -f ".deps/kernel.Tpo"; exit 1; fi
> In file included from kernel.h:25,
>                  from kernel.cpp:22:
> agent.h:109: warning: type qualifiers ignored on function return type
> kernel.cpp: In member function 'void Kernel::unregisterRole(Agent*, Role_t)':
> kernel.cpp:129: error: no matching function for call to 'find(std::_List_iterator<Agent*>, std::_List_iterator<Agent*>, Agent*&)'
> make[4]: *** [kernel.o] Error 1

--- src/mas/kernel.cpp~	2007-04-26 16:00:32.000000000 +0000
+++ src/mas/kernel.cpp	2007-04-26 16:00:53.000000000 +0000
@@ -23,6 +23,7 @@
 #include "agent.h"
 #include "message.h"
 
+#include <algorithm>
 #include <cassert>
 #include <iostream>
 
--- src/networking/netnode.h~	2007-04-26 16:01:51.000000000 +0000
+++ src/networking/netnode.h	2007-04-26 16:01:59.000000000 +0000
@@ -30,14 +30,14 @@
 
 class Netnode {
 public:
-	Netnode() {};
-	Netnode( IPaddress ipAdr, TCPsocket sock ):ip(ipAdr), socket(sock) {};
+	Netnode() {}
+	Netnode( IPaddress ipAdr, TCPsocket sock ):ip(ipAdr), socket(sock) {}
 	bool operator==( const Netnode& rc ) {
 		return ((this->ip.host == rc.ip.host) && (this->ip.port == rc.ip.port)
 			 && (this->socket == rc.socket));
-	};
+	}
 
-	~Netnode() {};
+	~Netnode() {}
 
 	IPaddress ip;
 	TCPsocket socket;
--- src/simulator/simulator.h~	2007-04-26 16:02:23.000000000 +0000
+++ src/simulator/simulator.h	2007-04-26 16:02:28.000000000 +0000
@@ -103,14 +103,14 @@
 		const uint & w1,
 		const uint & h1,
 		const uint & w2,
-		const uint & h2 ) {};
+		const uint & h2 ) {}
 
 	virtual void
 	RemoveStructure(
 		const uint & w1,
 		const uint & h1,
 		const uint & w2,
-		const uint & h2 ) {};
+		const uint & h2 ) {}
 
 
 	void
--- src/simulator/electricitysim.cpp~	2007-04-26 16:02:37.000000000 +0000
+++ src/simulator/electricitysim.cpp	2007-04-26 16:02:46.000000000 +0000
@@ -26,6 +26,8 @@
 
 #include "propertymanager.h"
 
+#include <algorithm>
+
 
 extern PropertyManager* gpPropertyMgr;	// Global property manager
 
--- src/triangulation/triangulation.h~	2007-04-26 16:01:09.000000000 +0000
+++ src/triangulation/triangulation.h	2007-04-26 16:01:14.000000000 +0000
@@ -34,8 +34,8 @@
 class Triangulation {
 public:
 
-	Triangulation() {};
-	virtual ~Triangulation() {};
+	Triangulation() {}
+	virtual ~Triangulation() {}
 
 //========================================================================
 /** Compute triangulation on vertex, return a Triangle[nVertex-2]
--- src/guibutton.h~	2007-04-26 16:03:19.000000000 +0000
+++ src/guibutton.h	2007-04-26 16:03:23.000000000 +0000
@@ -29,7 +29,7 @@
 */
 class GUIButton : public GUIMain {
 public:
-	GUIButton() {};
+	GUIButton() {}
 	GUIButton(
 		const int & rciX,
 		const int & rciY,
--- src/gui3dview.h~	2007-04-26 16:03:55.000000000 +0000
+++ src/gui3dview.h	2007-04-26 16:04:00.000000000 +0000
@@ -28,8 +28,8 @@
    */
 class GUI3DView : public GUIMain {
 public:
-	GUI3DView() {};
-	virtual ~GUI3DView() {};
+	GUI3DView() {}
+	virtual ~GUI3DView() {}
 
 };
 
--- src/pathfinder.cpp~	2007-04-26 16:04:18.000000000 +0000
+++ src/pathfinder.cpp	2007-04-26 16:04:25.000000000 +0000
@@ -23,6 +23,8 @@
 
 #include "pathfinder.h"
 
+#include <algorithm>
+
 #define OC_PATHFINDER_MAX_LENGTH	0xFFFF0000
 #define OC_PATHFINDER_A_STAR		1		// use Dijkstra + A* algorithm
 

-- 
Martin Michlmayr
http://www.cyrius.com/




More information about the Pkg-games-devel mailing list