- 论坛徽章:
- 0
|
原帖由 Godbach 于 2008-10-9 15:39 发表 ![]()
未定义的宏编译的时候还不报错吗
[rocky@build app]$ cat macro.c
#include <stdio.h>
#include <stdlib.h>
#if MAX > 5
#define PRINT() do{ puts("max >5 ");}while(0);
#else
#define PRINT() do{ puts("max <5 ");}while(0);
#endif
int main(int argc , char** argv)
{
PRINT();
return 0;
}
[rocky@build app]$ gcc -Wall macro.c -o m
[rocky@build app]$ gcc -v
Reading specs from /usr/local/gcc-3.3/lib/gcc-lib/x86_64-unknown-linux-gnu/3.3/specs
Configured with: ../configure --prefix=/usr/local/gcc-3.3 --enable-languages=c,c++
Thread model: posix
gcc version 3.3
[rocky@build app]$ |
|