我用C2000,。定义:
union DC_Log_REG DCA_Log[MAX_UNIT_PER];
然后在头文件声明:
extern union DC_Log_REG DCA_Log[MAX_UNIT_PER];
结果编译器警告:734-D array with incomplete element type is nonstandard
这是为什么呢?共同体变量不能声明称外部变量吗,之前似乎也没见过这种用法
This thread has been locked.
If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.
我用C2000,。定义:
union DC_Log_REG DCA_Log[MAX_UNIT_PER];
然后在头文件声明:
extern union DC_Log_REG DCA_Log[MAX_UNIT_PER];
结果编译器警告:734-D array with incomplete element type is nonstandard
这是为什么呢?共同体变量不能声明称外部变量吗,之前似乎也没见过这种用法
多谢陈工!
之前出现告警的原因是:声明共同体变量的那个头文件与定义该共同体的头文件没有关联起来。
我直接在同一个头文件定义共同体、声明变量就可以了。