debian-bugs-dist.lists.debian.org
[Top] [All Lists]

Bug#274270: realtimebattle: FTBFS with gcc-3.4: invalid initialization o

Subject: Bug#274270: realtimebattle: FTBFS with gcc-3.4: invalid initialization of reference of type 'const String&' from expression of type 'const char*'
From: Andreas Jochens
Date: Thu, 30 Sep 2004 20:25:24 +0200
Package: realtimebattle
Severity: normal
Tags: patch

When building 'realtimebattle' with gcc-3.4 I get the following error:

../include/List.h:108: error: invalid initialization of reference of type 
'const String&' from expression of type 'const char*'
../include/List.h:93: error: in passing argument 2 of `void Error(bool, const 
String&, const String&)'
../include/List.h: In member function `const ListIterator<T>& 
ListIterator<T>::operator--(int)':
../include/List.h:117: error: invalid initialization of reference of type 
'const String&' from expression of type 'const char*'
../include/List.h:93: error: in passing argument 2 of `void Error(bool, const 
String&, const String&)'

With the attached patch 'realtimebattle' can be compiled using gcc-3.4.

Regards
Andreas Jochens

diff -urN ../tmp-orig/realtimebattle-1.0.6/include/List.h ./include/List.h
--- ../tmp-orig/realtimebattle-1.0.6/include/List.h     2003-09-17 
19:30:20.000000000 +0200
+++ ./include/List.h    2004-09-30 20:17:14.863872176 +0200
@@ -21,11 +21,10 @@
 #define __LIST__
 
 #include <iostream>
+#include <String.h>
 
 using namespace std;
 
-class String;
-
 template<class T>
 struct ListNode
 {
@@ -90,7 +89,7 @@
   bool responsible_for_deletion;
 };
 
-void Error(const bool fatal, const String& error_msg, const String& 
function_name);
+void Error(const bool fatal, const String error_msg, const String 
function_name);
 
 template <class T>
 inline T*
diff -urN ../tmp-orig/realtimebattle-1.0.6/include/Various.h ./include/Various.h
--- ../tmp-orig/realtimebattle-1.0.6/include/Various.h  2003-09-18 
10:51:35.000000000 +0200
+++ ./include/Various.h 2004-09-30 20:16:13.255238112 +0200
@@ -59,7 +59,7 @@
   bool allow_sign;
 };
 
-void Error(const bool fatal, const String& error_msg, const String& 
function_name);
+void Error(const bool fatal, const String error_msg, const String 
function_name);
 void Quit(const bool success = true);
 
 int factorial(const int n);
diff -urN ../tmp-orig/realtimebattle-1.0.6/src/ArenaRealTime.cc 
./src/ArenaRealTime.cc
--- ../tmp-orig/realtimebattle-1.0.6/src/ArenaRealTime.cc       2003-09-17 
19:34:43.000000000 +0200
+++ ./src/ArenaRealTime.cc      2004-09-30 20:16:30.484618848 +0200
@@ -1073,7 +1073,7 @@
   int complete_rounds = n_o_sequences / games_per_round;
   int rem_games = n_o_sequences % games_per_round;
 
-  robots_in_sequence = new (int*)[n_o_sequences];
+  robots_in_sequence = new int*[n_o_sequences];
   for(int i=0; i<n_o_sequences; i++) robots_in_sequence[i] = new 
int[robots_per_game];
   
   int current_sequence[robots_per_game];
diff -urN ../tmp-orig/realtimebattle-1.0.6/src/List.cc ./src/List.cc
--- ../tmp-orig/realtimebattle-1.0.6/src/List.cc        2003-09-17 
19:39:15.000000000 +0200
+++ ./src/List.cc       2004-09-30 20:17:41.283855728 +0200
@@ -28,7 +28,7 @@
 #include "List.h"
 #include "String.h"
 
-void Error(const bool fatal, const String& error_msg, const String& 
function_name);
+void Error(const bool fatal, const String error_msg, const String 
function_name);
 
 template <class T>
 List<T>::List(bool resp)
diff -urN ../tmp-orig/realtimebattle-1.0.6/src/String.cc ./src/String.cc
--- ../tmp-orig/realtimebattle-1.0.6/src/String.cc      2003-09-17 
19:51:37.000000000 +0200
+++ ./src/String.cc     2004-09-30 20:18:56.074485824 +0200
@@ -34,7 +34,7 @@
 #include "String.h"
 
 
-void Error(const bool fatal, const String& function_name, const String& 
error_msg);
+void Error(const bool fatal, const String function_name, const String 
error_msg);
 
 String::String()
 {
diff -urN ../tmp-orig/realtimebattle-1.0.6/src/Various.cc ./src/Various.cc
--- ../tmp-orig/realtimebattle-1.0.6/src/Various.cc     2003-11-22 
18:09:28.000000000 +0100
+++ ./src/Various.cc    2004-09-30 20:18:04.926261536 +0200
@@ -69,7 +69,7 @@
 extern bool no_graphics;
 
 void
-Error(const bool fatal, const String& error_msg, const String& function_name)
+Error(const bool fatal, const String error_msg, const String function_name)
 {
   cerr << "RealTimeBattle: " << _("Error in") << " "
        << function_name << ": " << error_msg << endl;
diff -urN ../tmp-orig/realtimebattle-1.0.6/src/Vector2D.cc ./src/Vector2D.cc
--- ../tmp-orig/realtimebattle-1.0.6/src/Vector2D.cc    2000-02-15 
17:13:06.000000000 +0100
+++ ./src/Vector2D.cc   2004-09-30 20:18:38.182205864 +0200
@@ -25,7 +25,7 @@
 #include "Vector2D.h"
 #include "String.h"
 
-void Error(const bool fatal, const String& function_name, const String& 
error_msg);
+void Error(const bool fatal, const String function_name, const String 
error_msg);
 
 //  Vector2D::Vector2D()
 //  {


-- 
To UNSUBSCRIBE, email to debian-bugs-dist-REQUEST@xxxxxxxxxxxxxxxx
with a subject of "unsubscribe". Trouble? Contact listmaster@xxxxxxxxxxxxxxxx

<Prev in Thread] Current Thread [Next in Thread>
  • Bug#274270: realtimebattle: FTBFS with gcc-3.4: invalid initialization of reference of type 'const String&' from expression of type 'const char*', Andreas Jochens <=
Privacy Policy