Bug: Code analysis mistakes variables for functions

キャンセル
次の結果を表示 
表示  限定  | 次の代わりに検索 
もしかして: 

Bug: Code analysis mistakes variables for functions

558件の閲覧回数
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 返信

494件の閲覧回数
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 件の賞賛
返信