Polyspace: Only one (green) check despite expecting multiple hundreds of checks

1 view (last 30 days)
Hi, I am using polyspace to run the Code Prover for software components. However for some components I only receive one green check and the error message :
#error "MemMap.h was included without valid memory section define!"
which then leads to a failed compilation.
Expected were multiple checks (1000+).
I would appreciate any help regarding the matter.
Best regards,
Fabian
  1 Comment
Walter Roberson
Walter Roberson on 14 Sep 2022
https://www.mathworks.com/matlabcentral/answers/527508-autosar-memory-section-defines-in-generated-c-code is potentially relevant

Sign in to comment.

Answers (1)

Anirban
Anirban on 15 Sep 2022
Edited: Anirban on 15 Sep 2022
The answer depends on whether you used polyspace-autosar (to generate modules for software components from ARXML specifications and then analyze them) or polyspace-code-prover (to analyze the modules you had manually created).
I will give an answer assuming the latter. Since polyspace-autosar eventually uses polyspace-code-prover at the end, the answer should apply to both cases. A #error directive is typically a deliberate stop in the code. It is typically used to stop compilation if certain macros are not defined through compiler flags. Polyspace tries to emulate this compiler behavior and also stops the analysis if it encounters a #error directive. For an example, see Fix Polyspace Compilation Errors Related to #error Directive.
In a normal compilation, a #error directive is not meant to be hit. The fact that Polyspace is hitting one means that you have not sufficiently emulated your compilation through Polyspace options. You can go to the location of the #error directive, see what macros you need to define so Polyspace does not hit the #error directive and define those macros through the analysis option -D.
This is a general answer based on the information you have given. Generally, the #error problems can be tricky to fix because they might be related to some other setup issue. I will need more information on how you ran the analysis for a more concrete answer. Your best bet might be to contact Technical Support for more help with your problem. See also Contact Technical Support About Issues Running Polyspace.

Tags

Community Treasure Hunt

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

Start Hunting!