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

5 visualizaciones (últimos 30 días)
Trung Tran
Trung Tran el 5 de Jun. de 2022
Comentada: Trung Tran el 19 de Jun. de 2022
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)

Respuestas (1)

Anirban
Anirban el 7 de Jun. de 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 comentarios
Anirban
Anirban el 9 de Jun. de 2022
Editada: Anirban el 9 de Jun. de 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).
Trung Tran
Trung Tran el 19 de Jun. de 2022
Thanks. I investigated it and I can do it.

Iniciar sesión para comentar.

Community Treasure Hunt

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

Start Hunting!

Translated by