Commit 6793548868

Andrew Kelley <superjoe30@gmail.com>
2016-02-17 04:21:37
fix 64 bit integer printing for mingw
in order to do this I had to turn off -pedantic
1 parent 58c13aa
Changed files (2)
src/bignum.cpp
@@ -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);
     }
 }
 
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")