How to run Polyspace Bugfinder CLI with C++ header files (.hpp)?

4 次查看(过去 30 天)
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)

回答(1 个)

Anirban
Anirban 2022-6-7
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 个评论
Anirban
Anirban 2022-6-9
编辑:Anirban 2022-6-9
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).

请先登录,再进行评论。

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by