diff options
| author | nsfisis <nsfisis@gmail.com> | 2025-08-16 13:49:42 +0900 |
|---|---|---|
| committer | nsfisis <nsfisis@gmail.com> | 2025-08-16 13:49:42 +0900 |
| commit | 793eb9a574920dc39022246db8d5061cbc6b4615 (patch) | |
| tree | 348b50408aafbfec2a5315185c5380025e9c7181 | |
| parent | 7d65411b9c1ec122d8d00ecc71fa35c001030e18 (diff) | |
| download | ducc-793eb9a574920dc39022246db8d5061cbc6b4615.tar.gz ducc-793eb9a574920dc39022246db8d5061cbc6b4615.tar.zst ducc-793eb9a574920dc39022246db8d5061cbc6b4615.zip | |
fix: invalid error message
| -rw-r--r-- | preprocess.c | 6 |
1 files changed, 3 insertions, 3 deletions
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; |
