How to trigger C-preprocessor error about undefined symbol at #if? (LLVM/CLang/Xcode)
问题 How to trigger C-preprocessor error about missing definition at #if? I'm using LLVM/Clang/Xcode. This code works. #define AAAAA 1 #if AAAAA #endif And I expected this code will be an error for undefined symbol. //#define AAAAA 1 Removed definition. #if AAAAA #endif But it did not. Is this standard/regular behavior? And is there other way to triggering preprocessor error? 回答1: If you want to let the compiler check this for you, without rewriting your code, you can use the -Wundef switch as