Main Content

Fix Polyspace Compilation Errors Related to GNU Compiler

If you choose gnu for the option Compiler (-compiler), you can encounter this issue.

Issue

The Polyspace® analysis stops with a compilation error.

Cause

You are using certain advanced compiler-specific extensions that Polyspace does not support. See Limitations.

Solution

For easier portability of your code, avoid using the extensions.

If you want to use the extensions and still analyze your code, wrap the unsupported extensions in a preprocessor directive. For instance:

#ifdef POLYSPACE
    // Supported syntax
#else
    // Unsupported syntax
#endif
For regular compilation, do not define the macro POLYSPACE. For Polyspace analysis, enter POLYSPACE for the option Preprocessor definitions (-D).

If the compilation error is related to assembly language code, use the option -asm-begin -asm-end.