在程序中使用#error可以在编译的时候强制产生一个错误及提示
例如:
#ifndef SIGSEGV
#error "SIGNAL.H does not define SIGSEGV; running this program WILL cause a core dump/crash!"#endif
例如:
int main()
{#error "this is just used to test!"
return 0;}[root@lihao /]# make
cc test.ctest.c:6:2: #error "this is just used to test!"
make: *** [test] Error 1