Bug: Code analysis mistakes variables for functions

取消
显示结果 
显示  仅  | 搜索替代 
您的意思是: 

Bug: Code analysis mistakes variables for functions

731 次查看
scottm
Senior Contributor II

The code analysis module seems to have a bug relating to the handling of function pointer typedefs.  If you've got a typedef for a function pointer type that returns a typedef type like uint8_t, the analyzer will treat variable declarations of type uint8_t as function declarations and if they're declared static it'll warn that you've got an unused static function declaration:

Screenshot 2019-04-05 20.29.49.png

In this example, the expansion of 'uint8_t' is coming from one of the bare metal USB stack v5 files, which exist in the project tree but are in a folder excluded from the build and not in the include hierarchy of this file.  There are a few other similar typedefs for callbacks in my code and it's possible it's coming from something in the include hierarchy as well.  In any case, it shouldn't be happening.  Unused function declarations are one of the warnings that I always try to take care of and this isn't leaving me any option except to disable the check.

Scott

标签 (1)
标记 (1)
0 项奖励
回复
1 回复

667 次查看
lpcxpresso_supp
NXP Employee
NXP Employee

Unfortunately the code analysis module (aka "CODAN") within MCUXpresso IDE is the standard one provided by the underlying Eclipse/CDT framework, not something that we contribute to or have any direct control over.  Thus I'm afraid that this problem is not something we can assist with.

FYI, you can find more background on CODAN at:

Regards,

MCUXpresso IDE Support

0 项奖励
回复