|
发表于 2016-6-29 12:16:31
|
显示全部楼层
注意,这只是宏替换
$ cat test.c
#include <stdio.h>
#define F(n) 2*n
int main()
{
F(3+2);
F(3 + 2);
F(abc+123);
F(0zt6]-[80);
F(hello+word);
F(hello world);
F(HelloWorld);
F("Hello World");
return 0;
}
$ gcc test.c -E
...
...(这里只显示后面几行,前面的省略了)
extern int ftrylockfile (FILE *__stream) __attribute__ ((__nothrow__)) ;
extern void funlockfile (FILE *__stream) __attribute__ ((__nothrow__));
# 938 "/usr/include/stdio.h" 3 4
# 2 "test.c" 2
int main()
{
2*3+2;
2*3 + 2;
2*abc+123;
2*0zt6]-[80;
2*hello+word;
2*hello world;
2*HelloWorld;
2*"Hello World";
return 0;
}
注意,只是把括号中的所有东西放在n的位置 |
|