fix 64 bit integer printing for mingw

in order to do this I had to turn off -pedantic
master
Andrew Kelley 2016-02-16 20:21:37 -07:00
parent 58c13aa949
commit 6793548868
2 changed files with 4 additions and 2 deletions

View File

@ -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")

View File

@ -9,6 +9,7 @@
#include <assert.h>
#include <math.h>
#include <inttypes.h>
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);
}
}