Smaller change to fix more cases This reverts commit 0f36f60faa05da7e250a4b4eebd4b534e8a2b537.
Unified · Split
| @@ -753,7 +753,7 @@ static void error1(TCCState *s1, int is_warning, const char *fmt, va_list ap) · 752 unmodified lines | |||
| 753 | (*pf)->filename, (*pf)->line_num); | 753 | (*pf)->filename, (*pf)->line_num); |
| 754 | if (f->line_num > 0) { | 754 | if (f->line_num > 0) { |
| 755 | strcat_printf(buf, sizeof(buf), "%s:%d: ", | 755 | strcat_printf(buf, sizeof(buf), "%s:%d: ", |
| 756 | f->filename, f->line_num); | 756 | f->filename, f->line_num - !!(tok_flags & TOK_FLAG_BOL)); |
| 757 | } else { | 757 | } else { |
| 758 | strcat_printf(buf, sizeof(buf), "%s: ", | 758 | strcat_printf(buf, sizeof(buf), "%s: ", |
| 759 | f->filename); | 759 | f->filename); |
| @@ -1262,11 +1262,8 @@ ST_INLN void define_push(int v, int macro_type, TokenString *str, Sym *first_arg · 1261 unmodified lines | |||
| 1262 | s->next = first_arg; | 1262 | s->next = first_arg; |
| 1263 | table_ident[v - TOK_IDENT]->sym_define = s; | 1263 | table_ident[v - TOK_IDENT]->sym_define = s; |
| 1264 | 1264 | ||
| 1265 | if (o && !macro_is_equal(o->d, s->d)) { | 1265 | if (o && !macro_is_equal(o->d, s->d)) |
| 1266 | file->line_num--; | 1266 | tcc_warning("%s redefined", get_tok_str(v, NULL)); |
| 1267 | tcc_warning("%s redefined", get_tok_str(v, NULL)); | ||
| 1268 | file->line_num++; | ||
| 1269 | } | ||
| 1270 | } | 1267 | } |
| 1271 | 1268 | ||
| 1272 | /* undefined a define symbol. Its name is just set to zero */ | 1269 | /* undefined a define symbol. Its name is just set to zero */ |