How to add header files for project analysis in Polyspace?

조회 수: 25 (최근 30일)
When checking Polyspace using a manually created Polyspace project, only C files are scanned. Please provide information on how to include H files in the scan and options.
I included both *.C and *.H in the scan target. (Select Files of Type: All files (*.*) in the Open window) However, only *.C files are identified when checking files to be scanned in the Project browser.

채택된 답변

MathWorks Support Team
MathWorks Support Team 2023년 7월 10일
편집: MathWorks Support Team 2023년 7월 10일
As you can see from the captured Polyspace example demo project [Help menu > Examples > Bug_Finder_Example.psprj] below, the header files in the folder containing the source C files are automatically included in the scan target.
You can directly add header file folders in the above purple box. If there is a #included header file among the source code contents, the header file is found in the path specified in the Include folders during the source code compilation process on Polyspace.
The above cyan box option
in Configuration > Environment Settings means that all source codes included in the Polyspace project will be forced to #include "the corresponding header file". In some cases, the include option is called Pre-include depending on the compiler.
Note:  
The following are ways to filter the results as you want after compiling. In the above demo project 'Bug_Finder_Example.psprj', it has the option 'Generate results for sources and (-generate-results-for) ' as default 'source-headers'. It means that results appear on source files and header files in the same folder as the source files or in subfolders of source file folders. In the demo, it also has the option 'Do not generate results for (-do-not-generate-results-for)' as default 'include-folders'. It means that results are not generated for header files in include folders and their subfolders unless they are in the same folder as the source files. 

추가 답변 (0개)

태그

아직 태그를 입력하지 않았습니다.

제품


릴리스

R2021b

Community Treasure Hunt

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

Start Hunting!

Translated by