在isr.c中有
void (*InterruptHandlers[MAXHNDLRS])(void)={NULL,};
如果只是这样,在ads中编译编译报错,具体为:
Error :C2456E: undeclared name, inventing 'extern int NULL' Error :C2922W: '=': cast between function pointer and non-function object. Error :(Serious) C2432E: non-constant initialiser
通过比较别人的代码,然后在isr.c中include "def.h", def.h具体为
#ifndef __DEF_H__ #define __DEF_H__
#define U32 unsigned int #define BOOL int #define U16 unsigned short #define S32 int #define S16 short int #define U8 unsigned char #define S8 char #define u32 unsigned int #define u16 unsigned short #define s32 int #define s16 short int #define u8 unsigned char #define s8 char #define TRUE 1 #define FALSE 0 #define OK 1 #define FAIL 0 #define NULL 0
#endif /*__DEF_H__*/
然后编译,居然通过了,这里面的蹊跷是怎么样的呢?????
我在vc6.0里面定义void (*InterruptHandlers[MAXHNDLRS])(void)={NULL,}; 编译正确。
所以,这里面因为ads对指针有什么不一样吗? |