Polyspace does not generates Runtime report on Compilation failure

2 views (last 30 days)
Polyspace version : R2019b
What is the dependency with compiler while analysis?
Is it really require to provide compiled code for Polyspace Runtime Analysis report generation?
What if the native compiler is not supported with Polyspace and due to Preprocessor directives there are compilation errors reported while selecting Generic compiler?
As per Polyspace R2017b and higher versions it is expected that the analysis report shall be generated even if there is a compilation issue, but in our case we observed that the Polyspace executes Bug-finder but not prover and hence the generated report doesnot covers the Run-time reports.

Answers (1)

Anirban
Anirban on 29 Apr 2020
Edited: Anirban on 29 Apr 2020
Hi Gopesh,
I understand that by 'compiled code', you mean 'code that does not show compilation errors'.
If a compilation error occurs in a leaf function, both Bug Finder and Code Prover skips the file containing that function and you should see results in other files. If the error occurs in a function higher up in the hierarchy, then there is a difference. Bug Finder will show results in other files, but Code Prover might not.
The reason is that a Code Prover analysis starts from the 'main' function and continues analyzing down the call tree. If a function in the hierarchy has a compilation error, the entire branch of the tree starting from that function is turned 'off', so to speak. As an extreme example, if a compilation error occurs in 'main', the Code Prover analysis stops completely because it cannot go further down the hierarchy, and you are likely to see no results.
Now, about your specific compilation issue. Are you sure your compiler is not natively supported? Sometimes, for GCC-based compilers, it is better to start from 'gnux.x' than 'generic' for the option -compiler. Also, since it is an error related to a preprocessor directive, you might be able to work around the error using the options -D and -U, assuming it is a simple error. But your best bet is to contact MathWorks Technical Support. They can give you specific guidance to work around the compilation errors and even might help support your specific compiler.

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!