#define NULL 0结果出错的原因

来源:互联网 发布:javascript innerhtml 编辑:程序博客网 时间:2024/05/16 05:40

                 from /usr/include/stdio.h:72,
                 from structure.c:2:
/usr/lib/gcc/i386-redhat-linux/4.1.2/include/stddef.h:403:1: warning: this is the location of the previous definition 在gcc中用预定义#define 会遇到这样的问题,原因是如下的头文件中定义了这个。可问题是,我并没有引用这个头文件stddef.h,将#define NULL 0去掉后,问题解决了。
下面是/usr /include/linux下的stddef.h文件中的NULL定义:


#undef NULL
#if defined(__cplusplus)
#define NULL 0
#else
#define NULL ((void *)0)
#endif



0 0