Package: raidutils
Version: 0.0.4-5
Severity: normal
Tags: patch

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

 x86_64-linux-g++ -DHAVE_CONFIG_H -I. -I. -I.. -I../include -O3 -DMESSAGES 
-D_DPT_ACTIVE_ALIGNMENT -Dtrue=1 -Dfalse=0 -DHORIZONTAL -DNEW_RSC_MGR 
-DNEW_RSC_HDR -D_DPT_FLASH -DNEW_LOGGER -DI_WANT_SNI_DEBUG -D__UNIX__ -g -O2 
-MT libraidutil_la-engcalls.lo -MD -MP -MF .deps/libraidutil_la-engcalls.Tpo -c 
engcalls.cpp  -fPIC -DPIC -o .libs/libraidutil_la-engcalls.o
engcalls.cpp: In function 'char* AllocBuffers(uLONG, uLONG)':
engcalls.cpp:990: error: cast from 'char*' to 'int' loses precision
make[3]: *** [libraidutil_la-engcalls.lo] Error 1
make[3]: Leaving directory `/raidutils-0.0.4/lib'

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

Regards
Andreas Jochens

diff -urN ../tmp-orig/raidutils-0.0.4/lib/engcalls.cpp ./lib/engcalls.cpp
--- ../tmp-orig/raidutils-0.0.4/lib/engcalls.cpp        2004-04-29 
12:19:51.000000000 +0200
+++ ./lib/engcalls.cpp  2005-04-01 19:51:40.968507880 +0200
@@ -987,7 +987,7 @@
 
   /* The Attach Failed, So DeAllocate The Shared Memory */
 
-        if((int)SharedMemoryPtr == -1)
+        if((long)SharedMemoryPtr == -1)
           {
             shmctl(BufferID,IPC_RMID,&shm_buff);
             SharedMemoryPtr = NULL;
diff -urN ../tmp-orig/raidutils-0.0.4/raideng/device.cpp ./raideng/device.cpp
--- ../tmp-orig/raidutils-0.0.4/raideng/device.cpp      2004-04-29 
12:19:54.000000000 +0200
+++ ./raideng/device.cpp        2005-04-01 19:56:04.358123680 +0200
@@ -4067,9 +4067,10 @@
 
    if (basic_P->attachedTo!=0) {
        // Return this object's manager SCSI ID instead of tag
-      basic_P->attachedTo = myMgr_P()->getAddrL();
+      uLONG u = myMgr_P()->getAddrL();
        // Reverse the SCSI address bytes
-      reverseBytes(basic_P->attachedTo);
+      reverseBytes(u);
+      basic_P->attachedTo = u;
    }
      // Return the component list size
    fromEng_P->insert(compSize);
diff -urN ../tmp-orig/raidutils-0.0.4/raideng/eng_unix.cpp 
./raideng/eng_unix.cpp
--- ../tmp-orig/raidutils-0.0.4/raideng/eng_unix.cpp    2005-04-01 
19:58:35.835722408 +0200
+++ ./raideng/eng_unix.cpp      2005-04-01 19:56:24.455355552 +0200
@@ -491,7 +491,7 @@
 
   /* Make Sure That We Could Attach */
 
-            if((int)toEng_P != -1)
+            if((long)toEng_P != -1)
               {
                  fromEng_P = toEng_P + HdrBuff.FromEngBuffOffset;
 
diff -urN ../tmp-orig/raidutils-0.0.4/raideng/osd_unix.cpp 
./raideng/osd_unix.cpp
--- ../tmp-orig/raidutils-0.0.4/raideng/osd_unix.cpp    2004-05-05 
14:00:35.000000000 +0200
+++ ./raideng/osd_unix.cpp      2005-04-01 19:56:48.330879014 +0200
@@ -2639,7 +2639,7 @@
 
   /* The Attach Failed, So DeAllocate The Shared Memory */
 
-            if((int)SharedMemoryPtr == -1)
+            if((long)SharedMemoryPtr == -1)
               {
                 Rtnval = 1;
                 shmctl(BufferID,IPC_RMID,&shm_buff);
diff -urN ../tmp-orig/raidutils-0.0.4/raideng/scsi_obj.cpp 
./raideng/scsi_obj.cpp
--- ../tmp-orig/raidutils-0.0.4/raideng/scsi_obj.cpp    2004-04-29 
12:19:52.000000000 +0200
+++ ./raideng/scsi_obj.cpp      2005-04-01 19:57:37.375683365 +0200
@@ -441,9 +441,10 @@
    basic_P = (dptBasic_S *) (fromEng_P->data+fromEng_P->writeIndex);
    if (basic_P->attachedTo!=0) {
        // Return this object's manager SCSI ID instead of tag
-      basic_P->attachedTo = myMgr_P()->getAddrL();
+      uLONG u = myMgr_P()->getAddrL();
        // Reverse the SCSI address bytes
-      reverseBytes(basic_P->attachedTo);
+      reverseBytes(u);
+      basic_P->attachedTo = u;
 
    DEBUG(6, PRT_SADDR(basic_P) << "new attachedTo=0x" << hex << \
            basic_P->attachedTo << " is set");


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

Reply via email to