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.
This commit is contained in:
Sylvain Rochet 2016-12-09 14:11:21 +01:00
parent ac4d994249
commit a83c4e0897

View File

@ -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;