How to perform static code analysis

The static code code analysis features (sometime referred to under the brand name TrueINSPECTOR) have been removed from TrueSTUDIO Pro in version 6.0.0.This includes MISRA-C code checking and code complexity analysis.

Licensed users who still want to be able to perform static code analysis will need to use a version of TrueSTUDIO Pro prior to 6.0.0. There are two different use cases:

  • Using TrueSTUDIO v.5.5.x (new toolchain, supports Cortex-M7, requires project modifications)
  • Using TrueSTUDIO pre v.5.5.0 (old toolchain, no Cortex-M7 support, but works out-of-the-box)

 

In general....

Always use a workspace created by the version of Atollic TrueSTUDIO that you intend to use. For example, it is good practice to use move to a new workspace when switching from version 5.4.x to version 5.5.y. This is because the workspace contains tool configuration metadata which may only be compatible with the version of TrueSTUDIO it was created by.

 

Using TrueSTUDIO v.5.5.x

The new toolchain in TrueSTUDIO 5.5.x requires the user to define three symbols in order for the static code analysis tool to function properly:

  • __INTPTR_TYPE__=int
  • __deprecated__=__warning__
  • restricted=

These symbols are built-in compiler symbols. The static code analysis tool does however not recognise these, therefore they need to be defined explictly while performing a static code analysis. They can not be defined during a normal compilation. One possible way of managing this is by using separate build configurations for static code analysis. This is easily done by duplicating your normal build configuration (i.e. Release or Debug). Keep in mind that when using multiple build configuration one must be careful where settings are applied. Where to setup a symbol in a build configuration is shown in the User Guide, chapter: Compiler Settings.

 

Using TrueSTUDIO pre v.5.5.0

The only thing you need to consider is the recommendation under the headline In general...