Codeprover: all variables are unused
18 次查看(过去 30 天)
显示 更早的评论
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!