aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorseyko <seyko2@gmail.com>2016-05-16 03:21:26 +0300
committerseyko <seyko2@gmail.com>2016-05-16 03:21:26 +0300
commit0f36f60faa05da7e250a4b4eebd4b534e8a2b537 (patch)
treed69d15020f85f2283faa93e201b6b978a624fdf5
parenta37f8cfc805025019c93ae3114295eff363168a0 (diff)
downloadtinycc-0f36f60faa05da7e250a4b4eebd4b534e8a2b537.tar.gz
tinycc-0f36f60faa05da7e250a4b4eebd4b534e8a2b537.tar.bz2
fix line number in macro redefined message
-rw-r--r--tccpp.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/tccpp.c b/tccpp.c
index 024f9de..60f807b 100644
--- a/tccpp.c
+++ b/tccpp.c
@@ -1262,8 +1262,11 @@ ST_INLN void define_push(int v, int macro_type, TokenString *str, Sym *first_arg
s->next = first_arg;
table_ident[v - TOK_IDENT]->sym_define = s;
- if (o && !macro_is_equal(o->d, s->d))
- tcc_warning("%s redefined", get_tok_str(v, NULL));
+ if (o && !macro_is_equal(o->d, s->d)) {
+ file->line_num--;
+ tcc_warning("%s redefined", get_tok_str(v, NULL));
+ file->line_num++;
+ }
}
/* undefined a define symbol. Its name is just set to zero */