From 43efb7df2fe171facde6935340ace9ce1b9d6cfd Mon Sep 17 00:00:00 2001 From: Totto16 Date: Sat, 28 Dec 2024 18:10:41 +0100 Subject: [PATCH] fix: use helper printing macros, to use the correct printing width (e.g. %llu vs %lu) --- src/compiler/c_codegen.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/compiler/c_codegen.c b/src/compiler/c_codegen.c index 0dc38d61f..54170f231 100644 --- a/src/compiler/c_codegen.c +++ b/src/compiler/c_codegen.c @@ -1,5 +1,6 @@ #include "c_codegen_internal.h" +#include typedef struct OptionalCatch_ { @@ -346,11 +347,11 @@ static void c_emit_const_expr(GenContext *c, CValue *value, Expr *expr) } if (type_is_unsigned(t)) { - PRINTF("%s ___var_%d = %llu;\n", c_type_name(c, t), c_emit_temp(c, value, t), expr->const_expr.ixx.i.low); + PRINTF("%s ___var_%d = %" PRIu64 ";\n", c_type_name(c, t), c_emit_temp(c, value, t), expr->const_expr.ixx.i.low); } else { - PRINTF("%s ___var_%d = %lld;\n", c_type_name(c, t), c_emit_temp(c, value, t), expr->const_expr.ixx.i.low); + PRINTF("%s ___var_%d = %" PRId64 ";\n", c_type_name(c, t), c_emit_temp(c, value, t), (int64_t)expr->const_expr.ixx.i.low); } return; case CONST_BOOL: