Bug#386099: FTBFS with GCC 4.2: uses removed minimum/maximum operator

2007-06-28 Thread Jan Christoph Nordholz
tags 386099 + patch
thankyou

Hi,

this patch removes the definition of those operators for the included Integer 
and
Rational classes.


Regards,

Jan
diff -aur magnus-20060324.ORIG/back_end/libg++/include/Integer.h magnus-20060324/back_end/libg++/include/Integer.h
--- magnus-20060324.ORIG/back_end/libg++/include/Integer.h	2005-01-07 01:28:20.0 +0100
+++ magnus-20060324/back_end/libg++/include/Integer.h	2007-06-29 01:20:11.0 +0200
@@ -128,11 +128,6 @@
 
 // (constructive binary operations are inlined below)
 
-#if defined (__GNUG__) && ! defined (__STRICT_ANSI__)
-  friend Integer operator ? (const Integer& x, const Integer& y); // max
-#endif
-
 // builtin Integer functions that must be friends
 
   friend long lg (const Integer&); // floor log base 2 of abs(x)
@@ -688,18 +683,6 @@
   return *this;
 }
 
-#if defined (__GNUG__) && ! defined (__STRICT_ANSI__)
-inline Integer operator ? (const Integer& x, const Integer& y)
-{
-  return (compare(x.rep, y.rep) >= 0)?  x : y;
-}
-#endif
-
 
 inline void Integer::abs()
 {
diff -aur magnus-20060324.ORIG/back_end/libg++/include/Rational.h magnus-20060324/back_end/libg++/include/Rational.h
--- magnus-20060324.ORIG/back_end/libg++/include/Rational.h	2005-01-07 01:28:20.0 +0100
+++ magnus-20060324/back_end/libg++/include/Rational.h	2007-06-29 01:20:25.0 +0200
@@ -71,11 +71,6 @@
   Rational&operator *= (const Rational& y);
   Rational&operator /= (const Rational& y);
 
-#if defined (__GNUG__) && ! defined (__STRICT_ANSI__)
-  friend Rational  operator ? (const Rational& x, const Rational& y); // max
-#endif
-
   friend Rational  operator - (const Rational& x);
 
 
@@ -230,18 +225,6 @@
 inline const Integer& Rational::denominator() const { return den; }
 inline Rational::operator double() const { return ratio(num, den); }
 
-#if defined (__GNUG__) && ! defined (__STRICT_ANSI__)
-inline Rational operator ? (const Rational& x, const Rational& y)
-{
-  if (compare(x, y) >= 0) return x; else return y;
-}
-#endif
-
 #if defined(__GNUG__) && !defined(_G_NO_NRV)
 
 inline Rational operator + (const Rational& x, const Rational& y) return r


signature.asc
Description: Digital signature


Bug#386099: FTBFS with GCC 4.2: uses removed minimum/maximum operator

2006-09-05 Thread Martin Michlmayr
Package: magnus
Version: 20060324-3

Your package fails to build with GCC 4.2.  Version 4.2 has not been
released yet but I'm building with a snapshot in order to find errors
and give people an advance warning.  You're using an minimum/maximum
or similar operator (that is, , ?=) which has been removed
as of 4.2.  These operators have been removed since GCC 4.0 so please
let your upstream know about this issue.

You can reproduce this with the gcc-snapshot package from unstable
(20060823-1 or higher).


> Automatic build of magnus_20060324-3 on em64t by sbuild/amd64 0.49
...
> g++ -fno-operator-names -D_G_NO_NRV -Wno-deprecated -DHAVE_UNISTD_H 
> -DSAFETY=2 -I../global -Iinclude  -c src/Intdouble.C -o src/obj/Intdouble.o
> include/Integer.h:132: error: declaration of 'operator<' as non-function
> include/Integer.h:132: error: expected ';' before '?' token
> include/Integer.h:133: error: declaration of 'operator>' as non-function
> include/Integer.h:133: error: expected ';' before '?' token
> include/Integer.h:692: error: expected initializer before '?' token
> include/Integer.h:697: error: expected initializer before '?' token
> make[4]: *** [src/obj/Intdouble.o] Error 1
> make[4]: Leaving directory `/build/tbm/magnus-20060324/back_end/libg++'

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


-- 
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]