Skip to content

Commit

Permalink
fix: use helper printing macros, to use the correct printing width (e…
Browse files Browse the repository at this point in the history
….g. %llu vs %lu)
  • Loading branch information
Totto16 authored and lerno committed Dec 28, 2024
1 parent f5cea22 commit 43efb7d
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/compiler/c_codegen.c
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
#include "c_codegen_internal.h"

#include <inttypes.h>

typedef struct OptionalCatch_
{
Expand Down Expand Up @@ -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:
Expand Down

0 comments on commit 43efb7d

Please sign in to comment.