How to run Polyspace Bugfinder CLI with C++ header files (.hpp)?
4 views (last 30 days)
Show older comments
Hello Mathworks Support Team,
I'm a user of Polyspace Bugfinder. Normally, when I run Polyspace Bugfinder in command line with specific source files, I will do with the steps below:
polyspace-configure -allow-overwrite -compilation-database xxx.json
-output-options-file options.txt -include-sources xxx.cpp
And then:
polyspace-bug-finder -autosar-cpp14 all -options-file .../options.txt -do-not-generate-results-for all-headers
-results-dir .../polyspace-bug-finder
These command runs fine with .cpp files, but they can not run with .hpp files.
Can you instruct me the way to run Polyspace Bugfinder with header files (.hpp)
0 Comments
Answers (1)
Anirban
on 7 Jun 2022
Just trying to understand your use-case better.
Do you want to run Bug Finder on some header files by themselves, or do you want to run Bug Finder on headers included in sources? I am asking this because you have -do-not-generate-results-for all-headers, which explicitly asks not to show results on all headers. If you did want results on a subset of those headers, you can use -generate-results-for with paths to folders containing those headers.
3 Comments
Anirban
on 9 Jun 2022
Edited: Anirban
on 9 Jun 2022
You can write a simple source that #include-s the header and analyze the source (in this particular analysis, make sure to say -generate-results-for all-headers). The creation of this file can be done using scripts.
If your header file compiles on its own and the compilation information is there in your compilation database (xxx.json), your current commands should also work in principle (provided you remove the -do-not-generate-results-for all-headers).
See Also
Categories
Find more on Bug Finder Analysis with MATLAB Scripts in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!