Other Parts Discussed in Thread: AWR1843
工具/软件:Code Composer Studio
大家好、
使用 Flexelint 分析 C/C++项目时出现错误。
我们经常使用宏
#define Cyclprofiler_getTimeStamp () TSCL
但我们得到以下错误: 未声明的标识符'TSCL'[MISRA 2012规则1.3、必填]
有什么关于如何解决它的想法吗?
提前感谢。
此致、
Matteo Sticco
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.
Other Parts Discussed in Thread: AWR1843
工具/软件:Code Composer Studio
大家好、
使用 Flexelint 分析 C/C++项目时出现错误。
我们经常使用宏
#define Cyclprofiler_getTimeStamp () TSCL
但我们得到以下错误: 未声明的标识符'TSCL'[MISRA 2012规则1.3、必填]
有什么关于如何解决它的想法吗?
提前感谢。
此致、
Matteo Sticco
在编译器 c6x.h 文件内 、TSCL 的声明位于#if 块内:
#if defined (_TMS320C6400_plus)|| Defined (_TMS320C6740)|| Defined (_TMS320C6600) extern __cregister volatile unsigned int REP; extern __cregister volatile unsigned int TSCL;
您的 Flexelint 配置是否定义 了_TMS320C6740宏? (由于 AWR1843器件具有 C674x DSP)
我不熟悉 Flexelint, 我想它看到这条线...
extern __cregister volatile unsigned int TSCL;
但是、由于 extern、它不会作为 TSCL 的定义计数、而是仅计算声明。
我看到的唯一解决方案是添加与这些类似的行...
#ifdef Flexelint_in_use volatile unsigned int TSCL; #endif
请告诉我这项建议是否解决了问题。
谢谢、此致、
乔治
我 没有要研究的 Flexelint、但另一个可能的原因可能是__cregister 是 特定于 C6000编译器的关键字、而我不知道 Flexelint、这会导致无法正确解析 TSCL 的声明。
对于其他静态分析器、我看到了用于使分析器吞没编译器特定关键字的空哈希定义。 例如,将以下内容添加到 Flexelint 配置中:
#define __cregister
我尝试搜索了 Flexelint 预处理器输出的调试、但无法找到相关信息。