Package: sendip
Severity: normal
Tags: patch

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

gcc -o ipv4.so -fPIC -fsigned-char -pipe -Wall -Wpointer-arith -Wwrite-strings 
-Wstrict-prototypes -Wnested-externs -Winline -Werror -g -Wcast-align 
-DSENDIP_LIBS=\"/usr/lib/sendip\" -shared ipv4.c csum.o compact.o
cc1: warnings being treated as errors
ipv4.c: In function 'do_opt':
ipv4.c:212: warning: pointer targets in passing argument 1 of 'sprintf' differ 
in signedness
ipv4.c:213: warning: pointer targets in passing argument 1 of 'compact_string' 
differ in signedness
ipv4.c:240: warning: pointer targets in passing argument 5 of 'addoption' 
differ in signedness
ipv4.c:355: warning: pointer targets in passing argument 5 of 'addoption' 
differ in signedness
ipv4.c:380: warning: pointer targets in passing argument 5 of 'addoption' 
differ in signedness
ipv4.c:402: warning: pointer targets in passing argument 5 of 'addoption' 
differ in signedness
make[1]: *** [ipv4.so] Error 1
make[1]: Leaving directory `/sendip-2.5'
make: *** [build-stamp] Error 2

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

Regards
Andreas Jochens

diff -urN ../tmp-orig/sendip-2.5/ipv4.c ./ipv4.c
--- ../tmp-orig/sendip-2.5/ipv4.c       2003-04-21 15:23:22.000000000 +0200
+++ ./ipv4.c    2005-03-21 20:31:30.932016705 +0100
@@ -209,8 +209,8 @@
                                fprintf(stderr,"Out of memory!\n");
                                return FALSE;
                        }
-                       sprintf(data,"0x%s",arg);
-                       len = compact_string(data);
+                       sprintf((char*)data,"0x%s",arg);
+                       len = compact_string((char*)data);
                        cp=(*data&0x80)>>7;
                        cls=(*data&0x60)>>5;
                        num=(*data&0x1F);
@@ -237,7 +237,7 @@
                                free(data);
                                return FALSE;
                        } else {
-                               addoption(0,0,7,len+2,data,pack);
+                               addoption(0,0,7,len+2,(unsigned 
char*)data,pack);
                                free(data);
                        }
                } else if(!strcmp(opt+2, "ts")) {
@@ -352,7 +352,7 @@
                                data_in = next;
                        }
 
-                       addoption(0,2,4,data_out-data+2,data,pack);
+                       addoption(0,2,4,data_out-data+2,(unsigned 
char*)data,pack);
                        free(data);
                        /* End of timestamp parsing */
 
@@ -377,7 +377,7 @@
                                free(data);
                                return FALSE;
                        } else {
-                               addoption(1,0,3,len+2,data,pack);
+                               addoption(1,0,3,len+2,(unsigned 
char*)data,pack);
                                free(data);
                        }
                } else if(!strcmp(opt+2, "sid")) {
@@ -399,7 +399,7 @@
                                free(data);
                                return FALSE;
                        } else {
-                               addoption(1,0,9,len+2,data,pack);
+                               addoption(1,0,9,len+2,(unsigned 
char*)data,pack);
                                free(data);
                        }
                } else {
diff -urN ../tmp-orig/sendip-2.5/tcp.c ./tcp.c
--- ../tmp-orig/sendip-2.5/tcp.c        2003-06-10 22:15:43.000000000 +0200
+++ ./tcp.c     2005-03-21 20:35:46.951515667 +0100
@@ -204,8 +204,8 @@
                                fprintf(stderr,"Out of memory!\n");
                                return FALSE;
                        }
-                       sprintf(data,"0x%s",arg);
-                       len = compact_string(data);
+                       sprintf((char*)data,"0x%s",arg);
+                       len = compact_string((char*)data);
                        if(len==1)
                                addoption(*data,1,NULL,pack);
                        else
@@ -230,7 +230,7 @@
                        addoption(4,2,NULL,pack);
                } else if (!strcmp(opt+2, "sack")) {
                   /* Selective Acknowledge rfc1323 */
-                       unsigned char *next;
+                       char *next;
                        u_int32_t le, re;
                        u_int8_t *comb, *c;
                        int count=0;


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

Reply via email to