Test: 66_macro_concat_end...
--- 66_macro_concat_end.expect 2014-04-17 11:23:11.690041027 -0700
+++ 66_macro_concat_end.output 2014-05-27 11:09:52.556191608 -0700
@@ -1 +1 @@
-66_macro_concat_end.c:2: error: '##' invalid at end of macro
+66_macro_concat_end.c:1: error: '##' invalid at end of macro
Makefile:108: recipe for target '66_macro_concat_end.test' failed
make[2]: *** [66_macro_concat_end.test] Error 1
make[2]: Leaving directory '/home/austin/src/tinycc/tests/tests2'
Makefile:100: recipe for target 'moretests' failed
make[1]: *** [moretests] Error 2
make[1]: Leaving directory '/home/austin/src/tinycc/tests'
Makefile:346: recipe for target 'test' failed
make: *** [test] Error 2
address@hidden ~/src/tinycc $ uname -a
Linux aw25 3.13.3-gentoo-devlight-1 #1 SMP Thu Feb 20 00:10:55 Local time zone must be set--see zic x86_64 Intel(R) Core(TM) i7 CPU 960 @ 3.20GHz GenuineIntel GNU/Linux
commit bcf60562e056265d0197bd3765a4d5256e2ca7ec
Author: jiang <
address@hidden>
Date: Fri May 23 15:46:08 2014 +0800
The number of rows to display warning is wrong
For example:
#define TOK_ASM_weak TOK_WEAK1
#define TOK_ASM_weak TOK_WEAK
Output:
C8.c:3: warning: TOK_ASM_weak redefined
diff --git a/libtcc.c b/libtcc.c
index dc01831..721eaed 100644
--- a/libtcc.c
+++ b/libtcc.c
@@ -576,12 +576,15 @@ static void error1(TCCState *s1, int is_warning, const char *fmt, va_list ap)
for (f = file; f && f->filename[0] == ':'; f = f->prev)
;
if (f) {
+ int line_num = f->line_num;
for(pf = s1->include_stack; pf < s1->include_stack_ptr; pf++)
strcat_printf(buf, sizeof(buf), "In file included from %s:%d:\n",
(*pf)->filename, (*pf)->line_num);
- if (f->line_num > 0) {
+ if (line_num > 0) {
+ if(tok == TOK_LINEFEED)
+ line_num--;
strcat_printf(buf, sizeof(buf), "%s:%d: ",
- f->filename, f->line_num);
+ f->filename, line_num);
} else {
strcat_printf(buf, sizeof(buf), "%s: ",
f->filename);
--
-Austin