History

Redo "fix line number in macro redefined message"

Smaller change to fix more cases This reverts commit 0f36f60faa05da7e250a4b4eebd4b534e8a2b537.

grischka committed 10 years ago

Commit 9e0e05e1 parent bab45192 files · +3 −6Browse files

Unified · Split

2 files
  1. libtcc.c +1 −1
  2. tccpp.c +2 −5
libtcc.c+1−1
@@ -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);
tccpp.c+2−5
@@ -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 */

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t