【发布时间】:2021-03-10 19:03:18
【问题描述】:
对于宏,除了必须是标识符之外,还有其他名称限制吗?例如,以下内容是否有效?
#define assert getchar
#include <stdio.h>
int main(void)
{
assert();
}
代码链接:https://godbolt.org/z/ra63na.
main:
push rbp
mov rbp, rsp
mov eax, 0
call getchar
mov eax, 0
pop rbp
ret
预处理器是否了解 C 语言?还是更像是一个查找和替换程序?
【问题讨论】:
标签: c c-preprocessor