Bug: Code analysis mistakes variables for functions

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Bug: Code analysis mistakes variables for functions

471 Views
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

Labels (1)
Tags (1)
0 Kudos
1 Reply

407 Views
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 Kudos