compilation warnings: 'pointer targets ... differ in signedness'

Cristian Ionescu-Idbohrn cristian.ionescu-idbohrn at axis.com
Sat Sep 24 12:16:22 UTC 2005


Noticed a fair amount of those while compiling with:

  gcc (GCC) 4.0.2 20050917 (prerelease) (Debian 4.0.1-8)
  glibc 2.3.5-6

on a debian sid box.

Also a few non-signedness too.

Most of them should be easily fixed, like this one
(networking/ifconfig.c:576):

,----
|     static int in_ether(char *bufp, struct sockaddr *sap)
|     {
|             unsigned char *ptr;
|     ...
| 576         ptr = sap->sa_data;
`----

when:

,----
| /* Structure describing a generic socket address.  */
| struct sockaddr
|   {
|     __SOCKADDR_COMMON (sa_);    /* Common data: address family and length.  */
|     char sa_data[14];           /* Address data.  */
|   };
`----

--- networking/ifconfig.c.orig	2005-09-24 09:20:22.000000000 +0200
+++ networking/ifconfig.c	2005-09-24 14:10:36.000000000 +0200
@@ -567,7 +567,7 @@
 /* Input an Ethernet address and convert to binary. */
 static int in_ether(char *bufp, struct sockaddr *sap)
 {
-	unsigned char *ptr;
+	char *ptr;
 	int i, j;
 	unsigned char val;
 	unsigned char c;


See attached filtered logs.


Cheers,
Cristian
-------------- next part --------------
busybox-20050924/archival/libunarchive/decompress_bunzip2.c:532: warning: pointer targets in assignment differ in signedness
busybox-20050924/archival/libunarchive/decompress_unzip.c:553: warning: pointer targets in passing argument 2 of 'fill_bitbuffer' differ in signedness
busybox-20050924/archival/libunarchive/decompress_unzip.c:668: warning: pointer targets in passing argument 7 of 'huft_build' differ in signedness
busybox-20050924/archival/libunarchive/decompress_unzip.c:677: warning: pointer targets in passing argument 7 of 'huft_build' differ in signedness
busybox-20050924/archival/libunarchive/decompress_unzip.c:748: warning: pointer targets in passing argument 7 of 'huft_build' differ in signedness
busybox-20050924/archival/libunarchive/decompress_unzip.c:816: warning: pointer targets in passing argument 7 of 'huft_build' differ in signedness
busybox-20050924/archival/libunarchive/decompress_unzip.c:825: warning: pointer targets in passing argument 7 of 'huft_build' differ in signedness
busybox-20050924/coreutils/install.c:120: warning: pointer targets in assignment differ in signedness
busybox-20050924/coreutils/install.c:122: warning: pointer targets in assignment differ in signedness
busybox-20050924/coreutils/install.c:124: warning: pointer targets in passing argument 2 of 'copy_file' differ in signedness
busybox-20050924/coreutils/install.c:127: warning: pointer targets in passing argument 1 of 'chmod' differ in signedness
busybox-20050924/coreutils/install.c:133: warning: pointer targets in passing argument 1 of 'lchown' differ in signedness
busybox-20050924/coreutils/od.c:175: warning: pointer targets in passing argument 3 of 'getopt' differ in signedness
busybox-20050924/coreutils/od.c:178: warning: pointer targets in passing argument 1 of 'strchr' differ in signedness
busybox-20050924/coreutils/od.c:178: warning: pointer targets in assignment differ in signedness
busybox-20050924/coreutils/tr.c:165: warning: pointer targets in assignment differ in signedness
busybox-20050924/coreutils/tr.c:166: warning: pointer targets in assignment differ in signedness
busybox-20050924/coreutils/tr.c:195: warning: pointer targets in passing argument 2 of 'expand' differ in signedness
busybox-20050924/coreutils/tr.c:197: warning: pointer targets in passing argument 1 of 'complement' differ in signedness
busybox-20050924/coreutils/tr.c:201: warning: pointer targets in passing argument 2 of 'expand' differ in signedness
busybox-20050924/coreutils/tr.c:202: warning: pointer targets in passing argument 1 of 'map' differ in signedness
busybox-20050924/coreutils/tr.c:202: warning: pointer targets in passing argument 3 of 'map' differ in signedness
busybox-20050924/coreutils/uuencode.c:133: warning: pointer targets in passing argument 1 of 'uuencode' differ in signedness
busybox-20050924/editors/vi.c:350: warning: pointer targets in assignment differ in signedness
busybox-20050924/editors/vi.c:732: warning: pointer targets in assignment differ in signedness
busybox-20050924/editors/vi.c:766: warning: pointer targets in passing argument 1 of 'system' differ in signedness
busybox-20050924/editors/vi.c:790: warning: pointer targets in passing argument 1 of 'bb_strlen' differ in signedness
busybox-20050924/editors/vi.c:793: warning: pointer targets in passing argument 1 of 'bb_strlen' differ in signedness
busybox-20050924/editors/vi.c:2405: warning: pointer targets in passing argument 1 of 'write1' differ in signedness
busybox-20050924/editors/vi.c:2438: warning: pointer targets in passing argument 1 of 'bb_strlen' differ in signedness
busybox-20050924/editors/vi.c:2594: warning: pointer targets in passing argument 2 of 'strncat' differ in signedness
busybox-20050924/editors/vi.c:2683: warning: pointer targets in passing argument 1 of 'bufsum' differ in signedness
busybox-20050924/editors/vi.c:2688: warning: pointer targets in passing argument 1 of 'write1' differ in signedness
busybox-20050924/editors/vi.c:2691: warning: pointer targets in passing argument 1 of 'bb_strlen' differ in signedness
busybox-20050924/editors/vi.c:2945: warning: pointer targets in initialization differ in signedness
busybox-20050924/networking/arping.c:421: warning: pointer targets in passing argument 3 of 'getsockname' differ in signedness
busybox-20050924/networking/arping.c:442: warning: pointer targets in passing argument 3 of 'getsockname' differ in signedness
busybox-20050924/networking/arping.c:488: warning: pointer targets in passing argument 6 of 'recvfrom' differ in signedness
busybox-20050924/networking/arping.c:496: warning: pointer targets in passing argument 1 of 'recv_pack' differ in signedness
busybox-20050924/networking/httpd.c:855: warning: pointer targets in initialization differ in signedness
busybox-20050924/networking/ifconfig.c:576: warning: pointer targets in assignment differ in signedness
busybox-20050924/networking/telnet.c:219: warning: pointer targets in initialization differ in signedness
busybox-20050924/networking/telnetd.c:133: warning: pointer targets in initialization differ in signedness
busybox-20050924/networking/telnetd.c:533: warning: pointer targets in passing argument 3 of 'accept' differ in signedness
busybox-20050924/networking/wget.c:338: warning: pointer targets in passing argument 1 of 'base64enc' differ in signedness
busybox-20050924/networking/wget.c:342: warning: pointer targets in passing argument 1 of 'base64enc' differ in signedness
busybox-20050924/networking/zcip.c:343: warning: pointer targets in passing argument 1 of 'seed48' differ in signedness
busybox-20050924/networking/libiproute/iplink.c:197: warning: pointer targets in passing argument 3 of 'getsockname' differ in signedness
busybox-20050924/networking/libiproute/iplink.c:214: warning: pointer targets in passing argument 1 of 'll_addr_a2n' differ in signedness
busybox-20050924/networking/libiproute/libnetlink.c:52: warning: pointer targets in passing argument 3 of 'getsockname' differ in signedness
busybox-20050924/networking/libiproute/utils.c:197: warning: pointer targets in passing argument 1 of 'get_integer' differ in signedness
busybox-20050924/networking/udhcp/packet.c:73: warning: pointer targets in passing argument 1 of 'strncmp' differ in signedness
busybox-20050924/networking/udhcp/dhcpc.c:235: warning: pointer targets in passing argument 1 of 'strncpy' differ in signedness
busybox-20050924/networking/udhcp/dhcpc.c:247: warning: pointer targets in passing argument 1 of 'strncpy' differ in signedness
busybox-20050924/networking/udhcp/dhcpc.c:262: warning: pointer targets in passing argument 1 of 'strncpy' differ in signedness
busybox-20050924/networking/udhcp/dhcpc.c:279: warning: pointer targets in passing argument 1 of 'strncpy' differ in signedness
busybox-20050924/networking/udhcp/serverpacket.c:101: warning: pointer targets in passing argument 1 of 'strncpy' differ in signedness
busybox-20050924/networking/udhcp/serverpacket.c:103: warning: pointer targets in passing argument 1 of 'strncpy' differ in signedness
busybox-20050924/libbb/interface.c:506: warning: pointer targets in passing argument 1 of 'UNSPEC_print' differ in signedness
busybox-20050924/libbb/interface.c:1838: warning: pointer targets in passing argument 1 of 'hw->print' differ in signedness
busybox-20050924/libbb/loop.c:112: warning: pointer targets in passing argument 1 of 'safe_strncpy' differ in signedness
busybox-20050924/libbb/loop.c:122: warning: pointer targets in passing argument 2 of 'strcmp' differ in signedness
busybox-20050924/libbb/getopt_ulflags.c:217: warning: pointer targets in assignment differ in signedness
busybox-20050924/libbb/getopt_ulflags.c:265: warning: pointer targets in assignment differ in signedness
-------------- next part --------------
busybox-20050924/archival/tar.c:482: warning: missing sentinel in function call
busybox-20050924/networking/traceroute.c:296: warning: 'align' attribute directive ignored
busybox-20050924/shell/ash.c:2546: warning: 'sigsetmask' is deprecated (declared at /usr/include/signal.h:184)
busybox-20050924/shell/cmdedit.c:1442: warning: case label value exceeds maximum value for type
busybox-20050924/shell/cmdedit.c:1443: warning: case label value exceeds maximum value for type
busybox-20050924/shell/cmdedit.c:1449: warning: case label value exceeds maximum value for type
busybox-20050924/shell/cmdedit.c:1454: warning: case label value exceeds maximum value for type
busybox-20050924/shell/cmdedit.c:1455: warning: case label value exceeds maximum value for type
busybox-20050924/shell/cmdedit.c:1456: warning: case label value exceeds maximum value for type
busybox-20050924/shell/cmdedit.c:1461: warning: case label value exceeds maximum value for type
busybox-20050924/shell/cmdedit.c:1495: warning: case label value exceeds maximum value for type
busybox-20050924/shell/cmdedit.c:1500: warning: case label value exceeds maximum value for type
busybox-20050924/shell/cmdedit.c:1501: warning: case label value exceeds maximum value for type
busybox-20050924/shell/cmdedit.c:1522: warning: case label value exceeds maximum value for type
busybox-20050924/shell/cmdedit.c:1529: warning: case label value exceeds maximum value for type
busybox-20050924/shell/cmdedit.c:1530: warning: case label value exceeds maximum value for type
busybox-20050924/shell/cmdedit.c:1536: warning: case label value exceeds maximum value for type
busybox-20050924/shell/cmdedit.c:1537: warning: case label value exceeds maximum value for type
busybox-20050924/shell/cmdedit.c:1548: warning: case label value exceeds maximum value for type
busybox-20050924/shell/cmdedit.c:1556: warning: case label value exceeds maximum value for type
busybox-20050924/shell/cmdedit.c:1706: warning: case label value exceeds maximum value for type
busybox-20050924/shell/cmdedit.c:1707: warning: case label value exceeds maximum value for type


More information about the busybox mailing list