How can I make adaptions in my sources for a Polyspace Code Prover analysis in R2020a without changing the original code?
1 回表示 (過去 30 日間)
古いコメントを表示
MathWorks Support Team
2020 年 7 月 29 日
編集済み: MathWorks Support Team
2020 年 8 月 13 日
In some cases, it is necessary to make adaptions to the source code in order to allow Polyspace Code Prover to successfully analyze a code.
How can this be done without changing the original code?
採用された回答
MathWorks Support Team
2020 年 8 月 13 日
編集済み: MathWorks Support Team
2020 年 8 月 13 日
1) One way is to use Preprocessor definitions (-D):
But in case there are any space characters in the terms you want to remove or change this would not work,
i.e. -D my_macro=const volatile would work, but -D const volatile=volatile is not possible.
Another possibility it to collect all -D macro definitions in a separate header file which is later included in every C file using the option -include. This is a good way to define several macros instead of having to list them all in the project separately.
2) A post-preprocessing-command could be used:
This will be applied after the preprocessing.
3) Or you could make replacements in preprocessor directives using regular expressions directly:
This is also close to what the post-preprocessing-command does, but the regex replacement is done before the preprocessing.
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!