错误指令

如果预处理器遇到 #error 指令,则停止编译并打印包含的诊断消息。

#define DEBUG

#ifdef DEBUG
#error "Debug Builds Not Supported"
#endif

int main(void) {
    return 0;
}

可能的输出:

$ gcc error.c
error.c: error: #error "Debug Builds Not Supported"