[patch] 1.10.2: compiler warnings when building for i386 arch

Denys Vlasenko vda.linux at googlemail.com
Fri May 9 11:07:34 PDT 2008


On Friday 09 May 2008 17:46, Cristian Ionescu-Idbohrn wrote:
> with:
> 
>   gcc (GCC) 4.1.2 20061115 (prerelease) (Debian 4.1.1-21)
> 
>   CC      coreutils/ls.o
> .../busybox-1.10.2/coreutils/ls.c: In function 'ls_main':
> .../busybox-1.10.2/coreutils/ls.c:813: warning: pointer targets in passing argument 2 of 'get_terminal_width_height' differ in signedness
>   CC      coreutils/md5_sha1_sum.o
> .../busybox-1.10.2/coreutils/md5_sha1_sum.c: In function 'hash_bin_to_hex':
> .../busybox-1.10.2/coreutils/md5_sha1_sum.c:24: warning: pointer targets in return differ in signedness
> ...
>   CC      coreutils/stty.o
> .../busybox-1.10.2/coreutils/stty.c: In function 'display_window_size':
> .../busybox-1.10.2/coreutils/stty.c:764: warning: pointer targets in passing argument 2 of 'get_terminal_width_height' differ in signedness
> .../busybox-1.10.2/coreutils/stty.c:764: warning: pointer targets in passing argument 3 of 'get_terminal_width_height' differ in signedness
> .../busybox-1.10.2/coreutils/stty.c: In function 'stty_main':
> .../busybox-1.10.2/coreutils/stty.c:1317: warning: pointer targets in passing argument 2 of 'get_terminal_width_height' differ in signedness
> ...
>   CC      coreutils/tr.o
> .../busybox-1.10.2/coreutils/tr.c: In function 'tr_main':
> .../busybox-1.10.2/coreutils/tr.c:211: warning: pointer targets in passing argument 2 of 'expand' differ in signedness
> .../busybox-1.10.2/coreutils/tr.c:212: warning: pointer targets in passing argument 2 of 'map' differ in signedness
> ...
>   CC      libbb/appletlib.o
> .../busybox-1.10.2/libbb/appletlib.c: In function 'unpack_usage_messages':
> .../busybox-1.10.2/libbb/appletlib.c:55: warning: pointer targets in passing argument 3 of 'start_bunzip' differ in signedness
> ...
>   CC      miscutils/less.o
> .../busybox-1.10.2/miscutils/less.c: In function 'less_getch':
> .../busybox-1.10.2/miscutils/less.c:734: warning: pointer targets in passing argument 1 of 'getch_nowait' differ in signedness
> .../busybox-1.10.2/miscutils/less.c: In function 'less_main':
> .../busybox-1.10.2/miscutils/less.c:1383: warning: pointer targets in passing argument 2 of 'get_terminal_width_height' differ in signedness
> .../busybox-1.10.2/miscutils/less.c:1383: warning: pointer targets in passing argument 3 of 'get_terminal_width_height' differ in signedness
> ...
>   CC      networking/arp.o
> .../busybox-1.10.2/networking/arp.c: In function 'arp_getdevhw':
> .../busybox-1.10.2/networking/arp.c:203: warning: pointer targets in passing argument 1 of 'xhw->print' differ in signedness
> ...
>   CC      networking/sendmail.o
> .../busybox-1.10.2/networking/sendmail.c: In function 'sendgetmail_main':
> .../busybox-1.10.2/networking/sendmail.c:512: warning: pointer targets in passing argument 1 of 'bin2hex' differ in signedness
> 
> Is casting the right way to nuke those warnings?  See attached patch.
> (Didn't get to the bottom of the libbb/appletlib.c:55 warning.)

Applied except for get_terminal_width_height - I guess
it makes more sense to fix the function to take (unsigned*)
params.

BTW: do you pass additional -Wsomething to the build?
It makes sense to add it permanently to build system,
this will prevent people from introducing these warnings again.
--
vda


More information about the busybox mailing list