随Xcode一起提供的clang预处理器仅将 FILE 替换为文件名
#include <iostream>
int main()
{
std::cout << "__FILE__: " << __FILE__ << std::endl;
return 0;
}
谁能告诉我为什么?
$ clang++ test.cpp -o test; ./test
__FILE__: test.cpp . <--- I expected the absolute path
文件不应该替换为绝对路径吗?
clang --version
Apple LLVM version 9.1.0 (clang-902.0.39.2)
Target: x86_64-apple-darwin18.0.0
Thread model: posix