From: Wouter Wijngaards Date: Tue, 27 Oct 2015 14:51:57 +0000 (+0000) Subject: Fixup snprintf warning for 32bit systems. X-Git-Tag: release-1.5.7rc1~50 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=1af1e720d523deebcc848b1727d9659243ca81d5;p=thirdparty%2Funbound.git Fixup snprintf warning for 32bit systems. git-svn-id: file:///svn/unbound/trunk@3520 be551aaa-1e26-0410-a405-d3ace91eadb9 --- diff --git a/compat/snprintf.c b/compat/snprintf.c index 066355703..97cd7061f 100644 --- a/compat/snprintf.c +++ b/compat/snprintf.c @@ -42,6 +42,7 @@ #ifdef HAVE_STDINT_H #include #endif +#include /* for test */ /* #define SNPRINTF_TEST 1 */ @@ -428,7 +429,7 @@ print_num_llp(char** at, size_t* left, int* ret, void* value, char buf[PRINT_DEC_BUFSZ]; int negative = 0; int zero = (value == 0); -#if defined(UINTPTR_MAX) && defined(UINT32_MAX) && (UINTPTR_MAX == UINT32_MAX) +#if defined(SIZE_MAX) && defined(UINT32_MAX) && (UINT32_MAX == SIZE_MAX || INT32_MAX == SIZE_MAX) /* avoid warning about upcast on 32bit systems */ unsigned long long llvalue = (unsigned long)value; #else