Is there any discussion on this one? It should be pretty straightforward.

Without this fix, we get warnings such as:

networking/ftpd.c: In function 'bind_for_passive_mode':
networking/ftpd.c:126:21: warning: pointer targets in passing argument 3 of 
'getsockname' differ in signedness [-Wpointer-sign]
 #define G (*(struct globals*)&bb_common_bufsiz1)
                     ^
networking/ftpd.c:438:40: note: in expansion of macro 'G'
  getsockname(fd, &G.local_addr->u.sa, &G.local_addr->len);
                                        ^
In file included from 
/usr/local/arm-linux-androideabi/sysroot/usr/include/netdb.h:66:0,
                 from include/libbb.h:20,
                 from networking/ftpd.c:31:
/usr/local/arm-linux-androideabi/sysroot/usr/include/sys/socket.h:68:18: note: 
expected 'socklen_t *' but argument is of type 'bb_socklen_t *'
 __socketcall int getsockname(int, struct sockaddr *, socklen_t *);
                  ^


On Friday, 24 April 2015, at 4:12 am, Matt Whitlock wrote:
> BSD and POSIX specify socklen_t as int. Busybox should too, to avoid pointer 
> signedness warnings.
> ---
>  include/libbb.h | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/include/libbb.h b/include/libbb.h
> index f0ac1f5..dc0acd8 100644
> --- a/include/libbb.h
> +++ b/include/libbb.h
> @@ -143,7 +143,7 @@
>   * (in case "is it defined already" detection above failed)
>   */
>  #  define socklen_t bb_socklen_t
> -   typedef unsigned socklen_t;
> +   typedef int socklen_t;
>  # endif
>  #endif
>  #ifndef HAVE_CLEARENV
> -- 
> 2.0.5
> 
_______________________________________________
busybox mailing list
[email protected]
http://lists.busybox.net/mailman/listinfo/busybox

Reply via email to