Main Content

Fix Polyspace Compilation Errors Related to Keil or IAR Compiler

If you use the compiler, Keil or IAR, you can encounter this issue. For more information, see Compiler (-compiler).

Missing Identifiers

Issue

The analysis stops with the error message, expected an identifier, as if an identifier is missing. However, in your source code, you can see the identifier.

Cause

If you select Keil or IAR as your compiler, the software removes certain keywords during preprocessing. If you use these keywords as identifiers such as variable names, a compilation error occurs.

For a list of keywords that are removed, see Supported Keil or IAR Language Extensions.

Solution

Specify that Polyspace® must not remove the keywords during preprocessing. Define the macros __PST_KEIL_NO_KEYWORDS__ or __PST_IAR_NO_KEYWORDS__.

For more information, see Preprocessor definitions (-D).