| author | |
| committer | |
| log | 06398a22d0905e7e45ee7bdf4755aeee3b3fc1b0 |
| tree | bb15986ed033624e04fc82a96bd4f50da244963e |
| parent | bb806f941c81cca140b7554eac130fd365df871f |
disable warnings for format specifiers on mingw since the
compiler emits bogus warnings4 files changed, 13 insertions(+), 9 deletions(-)
CMakeLists.txt+6-1| ... | ... | @@ -181,7 +181,12 @@ include_directories( |
| 181 | 181 | |
| 182 | 182 | set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -Werror -Wall") |
| 183 | 183 | |
| 184 | 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") | |
| 184 | ||
| 185 | if(MINGW) | |
| 186 | set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -Wno-error=format= -Wno-error=format -Wno-error=format-extra-args") | |
| 187 | endif() | |
| 188 | ||
| 189 | 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 -D__USE_MINGW_ANSI_STDIO -Werror=strict-prototypes -Werror=old-style-definition -Werror=missing-prototypes") | |
| 185 | 190 | |
| 186 | 191 | add_executable(zig ${ZIG_SOURCES}) |
| 187 | 192 | set_target_properties(zig PROPERTIES |
src/analyze.cpp+4-4| ... | ... | @@ -396,7 +396,7 @@ TypeTableEntry *get_array_type(CodeGen *g, TypeTableEntry *child_type, uint64_t |
| 396 | 396 | entry->zero_bits = (array_size == 0) || child_type->zero_bits; |
| 397 | 397 | |
| 398 | 398 | buf_resize(&entry->name, 0); |
| 399 | buf_appendf(&entry->name, "[%" PRIuMAX "]%s", (uintmax_t)array_size, buf_ptr(&child_type->name)); | |
| 399 | buf_appendf(&entry->name, "[%" PRIu64 "]%s", array_size, buf_ptr(&child_type->name)); | |
| 400 | 400 | |
| 401 | 401 | if (!entry->zero_bits) { |
| 402 | 402 | uint64_t debug_size_in_bits = 8*LLVMStoreSizeOfType(g->target_data_ref, entry->type_ref); |
| ... | ... | @@ -4158,9 +4158,9 @@ static TypeTableEntry *analyze_builtin_fn_call_expr(CodeGen *g, ImportTableEntry |
| 4158 | 4158 | uint64_t src_align = get_memcpy_align(g, src_type->data.pointer.child_type); |
| 4159 | 4159 | if (dest_align != src_align) { |
| 4160 | 4160 | add_node_error(g, dest_node, buf_sprintf( |
| 4161 | "misaligned memcpy, '%s' has alignment '%" PRIuMAX ", '%s' has alignment %" PRIuMAX, | |
| 4162 | buf_ptr(&dest_type->name), (uintmax_t)dest_align, | |
| 4163 | buf_ptr(&src_type->name), (uintmax_t)src_align)); | |
| 4161 | "misaligned memcpy, '%s' has alignment '%" PRIu64 ", '%s' has alignment %" PRIu64, | |
| 4162 | buf_ptr(&dest_type->name), dest_align, | |
| 4163 | buf_ptr(&src_type->name), src_align)); | |
| 4164 | 4164 | } |
| 4165 | 4165 | } |
| 4166 | 4166 |
src/ast_render.cpp+2-2| ... | ... | @@ -351,7 +351,7 @@ void ast_print(FILE *f, AstNode *node, int indent) { |
| 351 | 351 | NumLit kind = node->data.number_literal.kind; |
| 352 | 352 | const char *name = node_type_str(node->type); |
| 353 | 353 | if (kind == NumLitUInt) { |
| 354 | fprintf(f, "%s uint %" PRIuMAX "\n", name, (uintmax_t)node->data.number_literal.data.x_uint); | |
| 354 | fprintf(f, "%s uint %" PRIu64 "\n", name, node->data.number_literal.data.x_uint); | |
| 355 | 355 | } else { |
| 356 | 356 | fprintf(f, "%s float %f\n", name, node->data.number_literal.data.x_float); |
| 357 | 357 | } |
| ... | ... | @@ -679,7 +679,7 @@ static void render_node(AstRender *ar, AstNode *node) { |
| 679 | 679 | case NodeTypeNumberLiteral: |
| 680 | 680 | switch (node->data.number_literal.kind) { |
| 681 | 681 | case NumLitUInt: |
| 682 | fprintf(ar->f, "%" PRIuMAX, (uintmax_t)node->data.number_literal.data.x_uint); | |
| 682 | fprintf(ar->f, "%" PRIu64, node->data.number_literal.data.x_uint); | |
| 683 | 683 | break; |
| 684 | 684 | case NumLitFloat: |
| 685 | 685 | fprintf(ar->f, "%f", node->data.number_literal.data.x_float); |
src/bignum.cpp+1-2| ... | ... | @@ -265,8 +265,7 @@ Buf *bignum_to_buf(BigNum *bn) { |
| 265 | 265 | return buf_sprintf("%f", bn->data.x_float); |
| 266 | 266 | } else { |
| 267 | 267 | const char *neg = bn->is_negative ? "-" : ""; |
| 268 | uintmax_t value = bn->data.x_uint; | |
| 269 | return buf_sprintf("%s%" PRIuMAX, neg, value); | |
| 268 | return buf_sprintf("%s%llu", neg, bn->data.x_uint); | |
| 270 | 269 | } |
| 271 | 270 | } |
| 272 | 271 |