AnsweredAssumed Answered

Bug: Code analysis mistakes variables for functions

Question asked by SCOTT MILLER on Apr 8, 2019
Latest reply on Apr 8, 2019 by LPCX presso support

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:

Code analysis bug


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.