From 55ca87c42543cdcde5e2f1100f13de7f37125fd3 Mon Sep 17 00:00:00 2001 From: Abdelrahman Said Date: Mon, 26 Jun 2023 07:32:42 +0100 Subject: [PATCH] Ensure token's line and column number are printed properly on macOS and Linux --- src/lexer/lexer.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/lexer/lexer.c b/src/lexer/lexer.c index 071b320..9751e7c 100644 --- a/src/lexer/lexer.c +++ b/src/lexer/lexer.c @@ -246,7 +246,8 @@ bool validate_json(char *json) { } void print_token(token_t token) { - printf("{LINE: %4lu, COLUMN: %4lu, TYPE: ", token.line, token.column); + printf("{LINE: %4llu, COLUMN: %4llu, TYPE: ", (unsigned long long)token.line, + (unsigned long long)token.column); switch (token.type) { case TK_NO_TOKEN: