reopen 326451
retitle 326451 FTBFS (amd64): cast from 'const void*' to 'int' loses precision
thanks

Hello,

thanks for fixing the Build-Depends. 

However, the patch contained a second part which was not applied.
When building 'jlint' on amd64/unstable, I still get the following error:

jlint.cc: In function 'void format_message(int, const utf_string&, int, 
__va_list_tag*)':
jlint.cc:153: error: cast from 'const void*' to 'int' loses precision
jlint.cc:228: error: cast from 'const void*' to 'int' loses precision
jlint.cc:240: warning: field precision should have type 'int', but argument 3 
has type 'long int'
jlint.cc:264: error: cast from 'const void*' to 'int' loses precision
jlint.cc: In function 'bool parse_class_file(byte*)':
jlint.cc:431: warning: unused variable 'desc_index'
jlint.cc:496: warning: unused variable 'max_stack'
jlint.cc:325: warning: unused variable 'minor_version'
jlint.cc:327: warning: unused variable 'major_version'
make[1]: *** [jlint.o] Error 1
make[1]: Leaving directory `/jlint-3.0'
make: *** [build-arch-stamp] Error 2

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

Regards
Andreas Jochens

diff -urN ../tmp-orig/jlint-3.0/jlint.cc ./jlint.cc
--- ../tmp-orig/jlint-3.0/jlint.cc      2004-01-14 16:23:20.000000000 +0000
+++ ./jlint.cc  2005-09-03 11:38:32.000000000 +0000
@@ -137,7 +137,7 @@
 
 void format_message(int code, utf_string const& file, int line, __VALIST ap)
 {
-  static int loop_id;
+  static long loop_id;
   static message_node *first, *last;
   static char* compound_message;
   const void* parameter[MAX_MSG_PARAMETERS];
@@ -150,7 +150,7 @@
     if (compound_message != NULL
         && ((loop_id != 0 
              && ((code != msg_loop && code != msg_sync_loop)
-                 || (int)parameter[2] != loop_id))
+                 || (long)parameter[2] != loop_id))
             || (loop_id == 0 && code != msg_wait_path)))
       {
         if (!message_node::find(compound_message)) { 
@@ -225,7 +225,7 @@
                            name.as_asciz()); 
             break;
           case 'd': // integer
-            dst += sprintf(dst, "%d", (int)parameter[index]);  
+            dst += sprintf(dst, "%ld", (long)parameter[index]);  
             break;
           default:
             assert(false/*bad message parameter format*/);
@@ -261,7 +261,7 @@
               compound_message = strdup(his_buf);
               first = last = new message_node(msg_buf);
               if (code != msg_wait) { 
-                loop_id = (int)parameter[2];
+                loop_id = (long)parameter[2];
               }
             } else if (!message_node::find(his_buf)) { 
               fprintf(stdout, "%s\n", msg_buf);


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

Reply via email to