Codeprover: all variables are unused
13 ビュー (過去 30 日間)
古いコメントを表示
Stein Heselmans
2018 年 2 月 22 日
回答済み: Stein Heselmans
2018 年 3 月 8 日
I am running polyspace codeprover on our software project. It seems like all variables are reported to be unused. Looking at the html report (Developer template):
There exists no reachable operation on variable ‘xxx’.
This message is repeated for every variable that we have (or close to, i didn't check all of them). The entrypoints (option -entry-points) are copied from our bugfinder configuration (which nicely detects missing critical sections) and contains our interrupts and boot point. The function main() is not included as that one gets called from the boot point. But it seems like the while-loop that we have in main() does not get taken into account...
Our boot point is implemented in a crt0.S in assembler. From that assembler code we call C-functions which eventually lead to main() being executed. Is codeprover/bugfinder able to handle this target-specific assembler? And can it find the entrypoint for main()? Or does it implicitly assume main() is an entrypoint?
I always assumed our configuration for bugfinder was ok, but looking at the codeprover results, and writing this down, makes me think how bugfinder/codeprover can know the non-interrupt entrypoint main().
0 件のコメント
採用された回答
Alexandre De Barros
2018 年 2 月 23 日
編集済み: Alexandre De Barros
2018 年 2 月 23 日
Hello,
If Polyspace Code Prover is able to find a function called main, it will automatically use it as the main entry point. By the way, Polyspace works with the C language only, so your assembly code is ignored/stubbed.
You are writing that you have a while loop in the main. That could be the explanation for the unreachable code. Indeed, with Code Prover (not Bug Finder) when the end of the main is unreachable, the entry-points (tasks, interrupts) are not "launched".
It means that you should see your entry-points in the list of unreachable functions in the dashboard (Code covered by verification).
And in this case, see this page to see what you have to do: https://www.mathworks.com/help/codeprover/ug/model-tasks-if-main-contains-infinite-loop.html
Best regards,
Alexandre
その他の回答 (1 件)
参考
カテゴリ
Help Center および File Exchange で Bug Finder Analysis についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!