Package: nstx
Severity: normal
Tags: patch

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

make[1]: Entering directory `/nstx-1.1-beta6'
cc -ggdb -Wall -Werror -Wsign-compare    -c -o nstxd.o nstxd.c
cc1: warnings being treated as errors
nstxd.c: In function 'do_timeout':
nstxd.c:175: warning: pointer targets in assignment differ in signedness
nstxd.c: In function 'nstx_getpacket':
nstxd.c:191: warning: pointer targets in passing argument 1 of 'dns_extractpkt' 
differ in signedness
nstxd.c:201: warning: pointer targets in passing argument 1 of 'nstx_decode' 
differ in signedness
nstxd.c:223: warning: pointer targets in assignment differ in signedness
make[1]: *** [nstxd.o] Error 1
make[1]: Leaving directory `/nstx-1.1-beta6'
make: *** [build-stamp] Error 2

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

Regards
Andreas Jochens

diff -urN ../tmp-orig/nstx-1.1-beta6/nstx_dns.c ./nstx_dns.c
--- ../tmp-orig/nstx-1.1-beta6/nstx_dns.c       2005-03-22 14:22:24.480816105 
+0100
+++ ./nstx_dns.c        2005-03-22 14:18:41.878141515 +0100
@@ -143,7 +143,7 @@
 {
    int len;
    
-   len = strlen(data);
+   len = strlen((char*)data);
    return _cstringify(data, &len, 63);
 }
 
@@ -200,7 +200,7 @@
        d += llen;
      } while (llen);
    *d = '\0';
-   return buf;
+   return (const unsigned char*)buf;
 }
 
 /* New DNS-Code */
@@ -318,7 +318,7 @@
    const char *ptr;
    static char *fqdn;
    
-   ptr = data2lbl(data);
+   ptr = (char*)data2lbl((unsigned char*)data);
    fqdn = realloc(fqdn, strlen(ptr)+strlen(suffix)+1);
    strcpy(fqdn, ptr);
    strcat(fqdn, suffix);
@@ -337,7 +337,7 @@
    
    off = strstr(fqdn, suffix);
    if (off)
-       buf = strdup(lbl2data(fqdn, off - fqdn));
+       buf = strdup((char*)lbl2data((unsigned char*)fqdn, off - fqdn));
    else
        /* Our suffix not found... */
        buf = NULL; 
@@ -364,7 +364,7 @@
    const char *ptr;
    char *buf;
    
-   ptr = data2txt(data, &len);
+   ptr = (char*)data2txt((unsigned char*)data, &len);
    buf = malloc(len);
    memcpy(buf, ptr, len);
    
@@ -477,7 +477,7 @@
      {
        offsets[i++] = ptr - buf;
        rrp = _new_listitem(&pkt->query);
-       rrp->data = decompress_label(buf, len, ptr);
+       rrp->data = decompress_label((char*)buf, len, (char*)ptr);
        if (!rrp->data)
          {
             syslog(LOG_ERR, "dns_extractpkt: decompress_label choked in qd\n");
diff -urN ../tmp-orig/nstx-1.1-beta6/nstx_encode.c ./nstx_encode.c
--- ../tmp-orig/nstx-1.1-beta6/nstx_encode.c    2005-03-22 14:22:24.480816105 
+0100
+++ ./nstx_encode.c     2005-03-22 14:15:16.428144462 +0100
@@ -34,7 +34,7 @@
    
    revmap = malloc(256);
    
-   for (i = 0; i < strlen(map); i++)
+   for (i = 0; i < strlen((char*)map); i++)
      revmap[map[i]] = i;
 }
    
@@ -70,7 +70,7 @@
    if (!revmap)
      init_revmap();
    
-   len = strlen(data);
+   len = strlen((char*)data);
 
    buf = realloc(buf, ((len+3)/4)*3);
    
diff -urN ../tmp-orig/nstx-1.1-beta6/nstx_tuntap.c ./nstx_tuntap.c
--- ../tmp-orig/nstx-1.1-beta6/nstx_tuntap.c    2004-06-27 23:43:34.000000000 
+0200
+++ ./nstx_tuntap.c     2005-03-22 14:20:18.778279573 +0100
@@ -215,7 +215,7 @@
 
 struct nstxmsg *nstx_select (int timeout)
 {
-   int peerlen;
+   unsigned peerlen;
    fd_set set;
    struct timeval tv;
    static struct nstxmsg *ret = NULL;
diff -urN ../tmp-orig/nstx-1.1-beta6/nstxcd.c ./nstxcd.c
--- ../tmp-orig/nstx-1.1-beta6/nstxcd.c 2004-06-27 23:43:34.000000000 +0200
+++ ./nstxcd.c  2005-03-22 14:22:16.841302705 +0100
@@ -110,11 +110,11 @@
    const char *data;
    int datalen;
    
-   pkt = dns_extractpkt (reply, len);
+   pkt = dns_extractpkt ((unsigned char*)reply, len);
    if (!pkt)
      return;
    while ((data = dns_getanswerdata(pkt, &datalen))) {
-      data = txt2data(data, &datalen);
+      data = (char*)txt2data((unsigned char*)data, &datalen);
       nstx_handlepacket (data, datalen, &sendtun);
    }
    dequeueitem(pkt->id);
@@ -159,9 +159,9 @@
     data += l;
     datalen -= l;
     
-    dns_addquery(pkt, dns_data2fqdn(nstx_encode(p, sizeof(nh)+l)));
+    dns_addquery(pkt, dns_data2fqdn(nstx_encode((unsigned char*)p, 
sizeof(nh)+l)));
     free(p);
-    p = dns_constructpacket(pkt, &l);
+    p = (char*)dns_constructpacket(pkt, &l);
     sendns(p, l, NULL);
     free(p);
 
diff -urN ../tmp-orig/nstx-1.1-beta6/nstxd.c ./nstxd.c
--- ../tmp-orig/nstx-1.1-beta6/nstxd.c  2004-06-27 23:55:17.000000000 +0200
+++ ./nstxd.c   2005-03-22 14:14:39.530330481 +0100
@@ -172,7 +172,7 @@
    dns_setid(pkt, q->id);
    dns_settype(pkt, DNS_RESPONSE);
    dns_addanswer(pkt, "\xb4\x00\x00\x00", 4, dns_addquery(pkt, q->name));
-   buf = dns_constructpacket (pkt, &len);
+   buf = (char*)dns_constructpacket (pkt, &len);
    sendns(buf, len, &q->peer);
    free(buf);
 }  
@@ -188,7 +188,7 @@
    
    if (msg) {
      if (msg->src == FROMNS) {
-       pkt = dns_extractpkt(msg->data, msg->len);
+       pkt = dns_extractpkt((unsigned char*)msg->data, msg->len);
        if (pkt)
          {
             name = dns_getquerydata(pkt);
@@ -198,7 +198,7 @@
                        name);
                  queueitem(pkt->id, name, &msg->peer);
                  if ((data = dns_fqdn2data(name)) &&
-                     (buf = nstx_decode(data, &len)))
+                     (buf = nstx_decode((unsigned char*)data, &len)))
                    {
                       nstx_handlepacket(buf, len, &sendtun);
                    }
@@ -220,7 +220,7 @@
       len = dns_getfreespace(pkt, DNS_RESPONSE);
       buf = dequeue_senditem(&len);
       dns_addanswer(pkt, buf, len, link);
-      buf = dns_constructpacket(pkt, &len);
+      buf = (char*)dns_constructpacket(pkt, &len);
       sendns(buf, len, &qitem->peer);
    }
    timeoutqueue(do_timeout);


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

Reply via email to