Codeprover: all variables are unused
18 vues (au cours des 30 derniers jours)
Afficher commentaires plus anciens
Stein Heselmans
le 22 Fév 2018
Réponse apportée : Stein Heselmans
le 8 Mar 2018
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 commentaires
Réponse acceptée
Alexandre De Barros
le 23 Fév 2018
Modifié(e) : Alexandre De Barros
le 23 Fév 2018
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
Plus de réponses (1)
Voir également
Catégories
En savoir plus sur Bug Finder Analysis dans Help Center et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!