mirror of
https://github.com/mirror/tinycc.git
synced 2025-01-21 05:40:09 +08:00
a3fc543459
---------------------------------------------------------------------- #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$
10 lines
157 B
C
10 lines
157 B
C
#include <stdio.h>
|
|
#define hexCh(c (c >= 10 ? 'a' + c - 10 : '0' + c)
|
|
|
|
int main(void)
|
|
{
|
|
int c = 0xa;
|
|
printf("hex: %c\n", hexCh(c));
|
|
return 0;
|
|
}
|