From 793eb9a574920dc39022246db8d5061cbc6b4615 Mon Sep 17 00:00:00 2001 From: nsfisis Date: Sat, 16 Aug 2025 13:49:42 +0900 Subject: fix: invalid error message --- preprocess.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'preprocess.c') diff --git a/preprocess.c b/preprocess.c index 636fd48..e5b820d 100644 --- a/preprocess.c +++ b/preprocess.c @@ -1135,7 +1135,7 @@ void process_define_directive(Preprocessor* pp, int hash_pos) { Token* macro_name = next_pp_token(pp); if (macro_name->kind != TokenKind_ident) { - fatal_error("%s:%s: invalid #define syntax", macro_name->loc.filename, macro_name->loc.line); + fatal_error("%s:%d: invalid #define syntax", macro_name->loc.filename, macro_name->loc.line); } if (peek_pp_token(pp)->kind == TokenKind_paren_l) { @@ -1144,7 +1144,7 @@ void process_define_directive(Preprocessor* pp, int hash_pos) { int replacements_start_pos = pp->pos; seek_to_next_newline(pp); if (pp_eof(pp)) { - fatal_error("%s:%s: invalid #define syntax"); + fatal_error("%s:%d: invalid #define syntax", macro_name->loc.filename, macro_name->loc.line); } Macro* macro = macros_push_new(pp->macros); macro->kind = MacroKind_func; @@ -1159,7 +1159,7 @@ void process_define_directive(Preprocessor* pp, int hash_pos) { int replacements_start_pos = pp->pos; seek_to_next_newline(pp); if (pp_eof(pp)) { - fatal_error("%s:%s: invalid #define syntax"); + fatal_error("%s:%d: invalid #define syntax", macro_name->loc.filename, macro_name->loc.line); } Macro* macro = macros_push_new(pp->macros); macro->kind = MacroKind_obj; -- cgit v1.2.3-70-g09d2