Package: qalculate
Version: 0.7.2-3
Severity: normal
Tags: patch

When building 'qalculate' on amd64/unstable with gcc-4.0,
I get the following error:

Function.cc:434: error: expected primary-expression before '>' token
Function.cc:434: error: missing template arguments before 'it'
Function.cc:434: error: expected `;' before 'it'
Function.cc:434: error: 'it' was not declared in this scope
Function.cc:434: error: 'argdefs' was not declared in this scope
Function.cc:442: error: 'argdefs' was not declared in this scope
../libqalculate/includes.h: At global scope:
../libqalculate/includes.h:92: warning: 'PRIMES' defined but not used
../libqalculate/includes.h:115: warning: 'SQUARE_PRIMES' defined but not used
make[5]: *** [Function.lo] Error 1
make[5]: Leaving directory `/qalculate-0.7.2/src/libqalculate'

This occurs because the configure checks for gettext cast a 64 bit
pointer to and (int) which causes an error 'cast from pointer to int
loses precision' with gcc-4.0. Consequently the gettext checks fail
on 64 bit architectures with gcc-4.0.

There is also a wrong check for the gcc version in
src/libqalculate/includes.h which has to be fixed to
work with gcc-4.0.

With the attached patch 'qalculate' can be compiled
on amd64 using gcc-4.0.

Regards
Andreas Jochens

diff -urN ../tmp-orig/qalculate-0.7.2/aclocal.m4 ./aclocal.m4
--- ../tmp-orig/qalculate-0.7.2/aclocal.m4      2005-04-12 23:32:13.437852743 
+0200
+++ ./aclocal.m4        2005-04-12 23:15:11.616795805 +0200
@@ -293,7 +293,7 @@
         [AC_TRY_LINK([
 #include <libintl.h>
 ],
-          [return (int) dgettext ("","")],
+          [return dgettext ("","") != 0],
          gt_cv_func_dgettext_libc=yes,
           gt_cv_func_dgettext_libc=no)
         ])
@@ -6964,7 +6964,7 @@
         [AC_TRY_LINK([
 #include <libintl.h>
 ],
-         [return (int) ngettext ("","", 1)],
+         [return ngettext ("","", 1) != 0],
          gt_cv_func_ngettext_libc=yes,
           gt_cv_func_ngettext_libc=no)
         ])
@@ -6974,7 +6974,7 @@
                [AC_TRY_LINK([
 #include <libintl.h>
 ],
-                 [return (int) dgettext ("","")],
+                 [return dgettext ("","") != 0],
                  gt_cv_func_dgettext_libc=yes,
                  gt_cv_func_dgettext_libc=no)
                ])
diff -urN ../tmp-orig/qalculate-0.7.2/configure ./configure
--- ../tmp-orig/qalculate-0.7.2/configure       2005-04-12 23:32:13.421855854 
+0200
+++ ./configure 2005-04-12 23:14:30.086899581 +0200
@@ -23019,7 +23019,7 @@
 int
 main ()
 {
-return (int) ngettext ("","", 1)
+return ngettext ("","", 1) != 0
   ;
   return 0;
 }
@@ -23077,7 +23077,7 @@
 int
 main ()
 {
-return (int) dgettext ("","")
+return dgettext ("","") != 0
   ;
   return 0;
 }
diff -urN ../tmp-orig/qalculate-0.7.2/src/libqalculate/includes.h 
./src/libqalculate/includes.h
--- ../tmp-orig/qalculate-0.7.2/src/libqalculate/includes.h     2004-11-21 
11:14:28.000000000 +0100
+++ ./src/libqalculate/includes.h       2005-04-12 23:26:51.412491639 +0200
@@ -33,7 +33,7 @@
        namespace Sgi { using ::hash_map; }; // inherit globals
 #   else
 #      include <ext/hash_map>
-#      if __GNUC_MINOR__ == 0
+#      if __GNUC__ == 3 && __GNUC_MINOR__ == 0
           namespace Sgi = std;               // GCC 3.0
 #      else
           namespace Sgi = ::__gnu_cxx;       // GCC 3.1 and later


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

Reply via email to