How to exclude preprocessed codes in Polyspace Code Prover
7 次查看(过去 30 天)
显示 更早的评论
MathWorks Support Team
2020-9-16
编辑: MathWorks Support Team
2020-9-16
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.
采纳的回答
MathWorks Support Team
2020-9-16
编辑:MathWorks Support Team
2020-9-16
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
0 个评论
更多回答(0 个)
另请参阅
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!