From 6793548868749ac7638000182fe9b730179b2b82 Mon Sep 17 00:00:00 2001 From: Andrew Kelley Date: Tue, 16 Feb 2016 20:21:37 -0700 Subject: [PATCH] fix 64 bit integer printing for mingw in order to do this I had to turn off -pedantic --- CMakeLists.txt | 2 +- src/bignum.cpp | 4 +++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 206e5e2da..230f60f94 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -179,7 +179,7 @@ include_directories( "${CMAKE_SOURCE_DIR}/src" ) -set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -Werror -Wall -pedantic") +set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -Werror -Wall") set(EXE_CFLAGS "-std=c++11 -fno-exceptions -fno-rtti -D_GNU_SOURCE -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS -D__STDC_LIMIT_MACROS -Werror=strict-prototypes -Werror=old-style-definition -Werror=missing-prototypes") diff --git a/src/bignum.cpp b/src/bignum.cpp index e98cce743..3eaf3ac35 100644 --- a/src/bignum.cpp +++ b/src/bignum.cpp @@ -9,6 +9,7 @@ #include #include +#include static void bignum_normalize(BigNum *bn) { assert(bn->kind == BigNumKindInt); @@ -264,7 +265,8 @@ Buf *bignum_to_buf(BigNum *bn) { return buf_sprintf("%f", bn->data.x_float); } else { const char *neg = bn->is_negative ? "-" : ""; - return buf_sprintf("%s%llu", neg, bn->data.x_uint); + uintmax_t value = bn->data.x_uint; + return buf_sprintf("%s%" PRIuMAX, neg, value); } }