From 18afed0f98d020608c65293ecb9246dab6c58db3 Mon Sep 17 00:00:00 2001 From: Johannes Schindelin Date: Wed, 1 Feb 2017 22:29:58 +0100 Subject: Use %I64* formats with MinGW instead of %ll* formats The MSVC runtime uses the format specified %I64 for 64-bit data types; It does not understand e.g. %llu for unsigned long longs. However, mingw-w64 provides a compatibility mode in its runtime wrapper which can be activated by defining the constant __USE_MINGW_ANSI_STDIO=1 in which case we must refrain from overriding the %ll* formats. This fixes quite a couple of compile warnings when building with the mingw-w64 compiler. Signed-off-by: Johannes Schindelin --- libbb/xatonum_template.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'libbb') diff --git a/libbb/xatonum_template.c b/libbb/xatonum_template.c index e0471983c..0d5d35b47 100644 --- a/libbb/xatonum_template.c +++ b/libbb/xatonum_template.c @@ -67,7 +67,7 @@ unsigned type FAST_FUNC xstrtou(_range_sfx)(const char *numstr, int base, if (r >= lower && r <= upper) return r; range: - bb_error_msg_and_die("number %s is not in %llu..%llu range", + bb_error_msg_and_die("number %s is not in %"LL_FMT"u..%"LL_FMT"u range", numstr, (unsigned long long)lower, (unsigned long long)upper); inval: @@ -144,7 +144,8 @@ type FAST_FUNC xstrto(_range_sfx)(const char *numstr, int base, } if (r < lower || r > upper) { - bb_error_msg_and_die("number %s is not in %lld..%lld range", + bb_error_msg_and_die("number %s is not in " + "%"LL_FMT"d..%"LL_FMT"d range", numstr, (long long)lower, (long long)upper); } -- cgit v1.2.3-55-g6feb