From a83c4e089706b3374e796f3f97892051ab2a38b3 Mon Sep 17 00:00:00 2001 From: Sylvain Rochet Date: Fri, 9 Dec 2016 14:11:21 +0100 Subject: [PATCH] PPP: fix build warning on wrong cast from void* to unsigned long ppp/utils.c: In function 'ppp_vslprintf': ppp/utils.c:251:12: error: cast from pointer to integer of different size [-Werror=pointer-to-int-cast] val = (unsigned long) va_arg(args, void *); ^ This is because a void* type is casted into an unsigned long type, which obviously isn't correct on LLP64 systems such as Windows. Actually, we are not using %p, thus we remove %p support completely instead of trying to fix the issue in unused code. --- src/netif/ppp/utils.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/netif/ppp/utils.c b/src/netif/ppp/utils.c index a5ae86f0..008c6337 100644 --- a/src/netif/ppp/utils.c +++ b/src/netif/ppp/utils.c @@ -247,11 +247,13 @@ int ppp_vslprintf(char *buf, int buflen, const char *fmt, va_list args) { val = va_arg(args, unsigned int); base = 16; break; +#if 0 /* unused (and wrong on LLP64 systems) */ case 'p': val = (unsigned long) va_arg(args, void *); base = 16; neg = 2; break; +#endif /* unused (and wrong on LLP64 systems) */ case 's': str = va_arg(args, char *); break;