How to exclude preprocessed codes in Polyspace Code Prover

8 visualizzazioni (ultimi 30 giorni)
I would like to know if there is an option to exclude preprocessed codes. When analyzing C code with Polyspace, the code that is excluded from compilation as a preprocessing macro is also analyzed and counted as the analysis result.

Risposta accettata

MathWorks Support Team
MathWorks Support Team il 16 Set 2020
Modificato: MathWorks Support Team il 16 Set 2020
Polyspace Code Prover does not analyze preprocessed code as below. It is displayed in gray color, but there is a difference between the light (excluded)/dark (actual Gray result) color of the gray color.
Here is an example code to show two kinds of grey color: light grey when the code is not processed, and dark grey when the code is processed but unreachable.
int f(void) {
int x=0;
#ifdef DEF
x++; // not processed (light grey)
#endif
if (0 == 1)
x++; // processed and unreachable because the if condition is always false
return x;
}
You can see more description of colors used in Polyspace Code Prover at the following documentation:
- Code Prover Result and Source Code Colors

Più risposte (0)

Tag

Non è stata ancora inserito alcun tag.

Prodotti


Release

R2020a

Community Treasure Hunt

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

Start Hunting!

Translated by