专家你好,
我在编译过程中出现了以下警告信息:
Description Resource Path Location Type
#161-D declaration is incompatible with previous "InitECana" (declared at line 24) DSP2803x_ECan.c /DCDC1500W_Compile line 27 C/C++ Problem
Description Resource Path Location Type
#161-D declaration is incompatible with previous "InitECanaGpio" (declared at line 158) DSP2803x_ECan.c /DCDC1500W_Compile line 161 C/C++ Problem
Description Resource Path Location Type
<a href="file:/F:/ti/ccsv6/tools/compiler/dmed/HTML/225.html">#225-D</a> function "InitECan" declared implicitly Ecan.c /DCDC1500W_Compile/source line 48 C/C++ Problem
Description Resource Path Location Type
<a href="file:/F:/ti/ccsv6/tools/compiler/dmed/HTML/225.html">#225-D</a> function "InitECana" declared implicitly DSP2803x_ECan.c /DCDC1500W_Compile line 24 C/C++ Problem
Description Resource Path Location Type
<a href="file:/F:/ti/ccsv6/tools/compiler/dmed/HTML/225.html">#225-D</a> function "InitECanaGpio" declared implicitly DSP2803x_ECan.c /DCDC1500W_Compile line 158 C/C++ Problem
Description Resource Path Location Type
<a href="file:/F:/ti/ccsv6/tools/compiler/dmed/HTML/225.html">#225-D</a> function "InitECanGpio" declared implicitly Ecan.c /DCDC1500W_Compile/source line 49 C/C++ Problem
函数在【DSP2803x_GlobalPrototypes.h】中已声明,内容如下:
#if DSP28_ECANA
extern void InitECan(void);
extern void InitECana(void);
extern void InitECanGpio(void);
extern void InitECanaGpio(void);
#endif // endif DSP28_ECANA
DSP28_ECANA在【DSP2803x_Device.h】中定义:
#define TARGET 1
#define DSP28_28035PN TARGET
#if (DSP28_28035PN||DSP28_28034PN||DSP28_28033PN||DSP28_28032PN||DSP28_28031PN||DSP28_28030PN)
……..
#define DSP28_ECANA 1
…….
#endif
我将函数声明处的开关注释掉,Warning就被消除了,如下
//#if DSP28_ECANA
extern void InitECan(void);
extern void InitECana(void);
extern void InitECanGpio(void);
extern void InitECanaGpio(void);
//#endif // endif DSP28_ECANA
但是这个【DSP2803x_Device.h】文件是标准库文件,一般不应该修改,而且这里的开关DSP28_ECANA用法也应该没什么问题,为什么会出现这种情况呢?是我的CCS环境配置问题吗?我的编译版本是v6.4.2
Seven Han:您好,
在DSP2833x_Examples.h文件中有include DSP2833x_GlobalPrototypes.h文件吗?
DSP28x_Project.h也要包含DSP2833x_Examples.h文件。
确认下以上两点应该可以去掉warning。
专家你好,
我在编译过程中出现了以下警告信息:
Description Resource Path Location Type
#161-D declaration is incompatible with previous "InitECana" (declared at line 24) DSP2803x_ECan.c /DCDC1500W_Compile line 27 C/C++ Problem
Description Resource Path Location Type
#161-D declaration is incompatible with previous "InitECanaGpio" (declared at line 158) DSP2803x_ECan.c /DCDC1500W_Compile line 161 C/C++ Problem
Description Resource Path Location Type
<a href="file:/F:/ti/ccsv6/tools/compiler/dmed/HTML/225.html">#225-D</a> function "InitECan" declared implicitly Ecan.c /DCDC1500W_Compile/source line 48 C/C++ Problem
Description Resource Path Location Type
<a href="file:/F:/ti/ccsv6/tools/compiler/dmed/HTML/225.html">#225-D</a> function "InitECana" declared implicitly DSP2803x_ECan.c /DCDC1500W_Compile line 24 C/C++ Problem
Description Resource Path Location Type
<a href="file:/F:/ti/ccsv6/tools/compiler/dmed/HTML/225.html">#225-D</a> function "InitECanaGpio" declared implicitly DSP2803x_ECan.c /DCDC1500W_Compile line 158 C/C++ Problem
Description Resource Path Location Type
<a href="file:/F:/ti/ccsv6/tools/compiler/dmed/HTML/225.html">#225-D</a> function "InitECanGpio" declared implicitly Ecan.c /DCDC1500W_Compile/source line 49 C/C++ Problem
函数在【DSP2803x_GlobalPrototypes.h】中已声明,内容如下:
#if DSP28_ECANA
extern void InitECan(void);
extern void InitECana(void);
extern void InitECanGpio(void);
extern void InitECanaGpio(void);
#endif // endif DSP28_ECANA
DSP28_ECANA在【DSP2803x_Device.h】中定义:
#define TARGET 1
#define DSP28_28035PN TARGET
#if (DSP28_28035PN||DSP28_28034PN||DSP28_28033PN||DSP28_28032PN||DSP28_28031PN||DSP28_28030PN)
……..
#define DSP28_ECANA 1
…….
#endif
我将函数声明处的开关注释掉,Warning就被消除了,如下
//#if DSP28_ECANA
extern void InitECan(void);
extern void InitECana(void);
extern void InitECanGpio(void);
extern void InitECanaGpio(void);
//#endif // endif DSP28_ECANA
但是这个【DSP2803x_Device.h】文件是标准库文件,一般不应该修改,而且这里的开关DSP28_ECANA用法也应该没什么问题,为什么会出现这种情况呢?是我的CCS环境配置问题吗?我的编译版本是v6.4.2
user5194104:
回复 Seven Han:
Dear Seven
非常感谢您的回复。
我现在使用的是28035,用的是controlSUITE中的标准文件,其中的DSP2803x_Examples.h文件中有include DSP2803x_GlobalPrototypes.h文件,DSP28x_Project.h也包含了DSP2803x_Examples.h文件。
专家你好,
我在编译过程中出现了以下警告信息:
Description Resource Path Location Type
#161-D declaration is incompatible with previous "InitECana" (declared at line 24) DSP2803x_ECan.c /DCDC1500W_Compile line 27 C/C++ Problem
Description Resource Path Location Type
#161-D declaration is incompatible with previous "InitECanaGpio" (declared at line 158) DSP2803x_ECan.c /DCDC1500W_Compile line 161 C/C++ Problem
Description Resource Path Location Type
<a href="file:/F:/ti/ccsv6/tools/compiler/dmed/HTML/225.html">#225-D</a> function "InitECan" declared implicitly Ecan.c /DCDC1500W_Compile/source line 48 C/C++ Problem
Description Resource Path Location Type
<a href="file:/F:/ti/ccsv6/tools/compiler/dmed/HTML/225.html">#225-D</a> function "InitECana" declared implicitly DSP2803x_ECan.c /DCDC1500W_Compile line 24 C/C++ Problem
Description Resource Path Location Type
<a href="file:/F:/ti/ccsv6/tools/compiler/dmed/HTML/225.html">#225-D</a> function "InitECanaGpio" declared implicitly DSP2803x_ECan.c /DCDC1500W_Compile line 158 C/C++ Problem
Description Resource Path Location Type
<a href="file:/F:/ti/ccsv6/tools/compiler/dmed/HTML/225.html">#225-D</a> function "InitECanGpio" declared implicitly Ecan.c /DCDC1500W_Compile/source line 49 C/C++ Problem
函数在【DSP2803x_GlobalPrototypes.h】中已声明,内容如下:
#if DSP28_ECANA
extern void InitECan(void);
extern void InitECana(void);
extern void InitECanGpio(void);
extern void InitECanaGpio(void);
#endif // endif DSP28_ECANA
DSP28_ECANA在【DSP2803x_Device.h】中定义:
#define TARGET 1
#define DSP28_28035PN TARGET
#if (DSP28_28035PN||DSP28_28034PN||DSP28_28033PN||DSP28_28032PN||DSP28_28031PN||DSP28_28030PN)
……..
#define DSP28_ECANA 1
…….
#endif
我将函数声明处的开关注释掉,Warning就被消除了,如下
//#if DSP28_ECANA
extern void InitECan(void);
extern void InitECana(void);
extern void InitECanGpio(void);
extern void InitECanaGpio(void);
//#endif // endif DSP28_ECANA
但是这个【DSP2803x_Device.h】文件是标准库文件,一般不应该修改,而且这里的开关DSP28_ECANA用法也应该没什么问题,为什么会出现这种情况呢?是我的CCS环境配置问题吗?我的编译版本是v6.4.2
user5194104:
回复 Seven Han:
Dear Seven,
感谢你这么积极的回复。
经过排除比较后,最终发现之前因调试需要,在DSP2803x_Device.h中添加了一行【#include "DSP2803x_GlobalPrototypes.h"】,结果导致了现在的warning,原因应该是将函数的声明与调用顺序打乱了。
在重新下载了controlSuite后,该warning已经消除。
再次感谢你的帮助,并提醒其他人不要轻易修改库文件。