From a3fc54345949535524d01319e1ca6378b7c2c201 Mon Sep 17 00:00:00 2001 From: jiang <30155751@qq.com> Date: Sun, 29 Jun 2014 20:35:57 +0800 Subject: bug: ---------------------------------------------------------------------- #define hexCh(c (c >= 10 ? 'a' + c - 10 : '0' + c) hexCh(c); out: jiang@jiang:~/test$ ./tcc -E c4.c # 1 "c4.c" (c >= 10 ? 'a' + c - 10 : '0' + c); --------------------------------------------------------------- #define hexCh(c/3) (c >= 10 ? 'a' + c - 10 : '0' + c) hexCh(c); out: jiang@jiang:~/test$ ./tcc -E c4.c # 1 "c4.c" /3) (c >= 10 ? 'a' + c - 10 : '0' + c); jiang@jiang:~/test$ after patch: # 1 "c4.c" c4.c:1: error: may not appear in macro parameter list: "(" jiang@jiang:~/test$ jiang@jiang:~/test$ ./tcc -E c4.c # 1 "c4.c" c4.c:1: error: may not appear in macro parameter list: "/" jiang@jiang:~/test$ --- tests/tests2/69_macro_concat.c | 9 +++++++++ 1 file changed, 9 insertions(+) create mode 100644 tests/tests2/69_macro_concat.c (limited to 'tests/tests2/69_macro_concat.c') diff --git a/tests/tests2/69_macro_concat.c b/tests/tests2/69_macro_concat.c new file mode 100644 index 0000000..3b16313 --- /dev/null +++ b/tests/tests2/69_macro_concat.c @@ -0,0 +1,9 @@ +#include +#define hexCh(c/3) (c >= 10 ? 'a' + c - 10 : '0' + c) + +int main(void) +{ + int c = 0xa; + printf("hex: %c\n", hexCh(c)); + return 0; +} -- cgit v1.3.1