How to exclude preprocessed codes in Polyspace Code Prover
4 ビュー (過去 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 件)
参考
カテゴリ
Help Center および File Exchange で Run Settings についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!