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

7 visualizzazioni (ultimi 30 giorni)
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)

Risposte (1)

Anirban
Anirban il 7 Giu 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 Commenti
Anirban
Anirban il 9 Giu 2022
Modificato: Anirban il 9 Giu 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).

Accedi per commentare.

Community Treasure Hunt

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

Start Hunting!

Translated by