What are the roles of include folders, include options and the #include directive,etc... in Polyspace?
19 views (last 30 days)
Show older comments
MathWorks Support Team
on 3 Dec 2014
Answered: MathWorks Support Team
on 15 Jan 2015
What are the roles of the include folders, the include options, the #include directive,etc... ?
Accepted Answer
MathWorks Support Team
on 3 Dec 2014
By default, in the C and C++ languages, header files are included in the source files with the #include directive.
Ex.
#include <stdio.h>
...
In order to tell Polyspace where these header files to include are, the user needs to specify include folders. This is done, when setting up a project, by adding these include folders to the project (the 'Include' folder of a project, int the Project Browser view).
When Polyspace will analyze each source file at the beginning of the verification or analysis process, it will process the #include directives and will look for the requested include files (like stdio.h) in the different include folders.
NB: The corresponding command line option to define the include folders is -I.
The other way to include header files is by using the option -include, found in the Environment Settings topic on the configuration.
The role of this option is to automatically include a header file in every source files. It is equivalent to have a #include directive in every source files of the project.
With this option -include, the user will specify a header file, and not an folder.
This option can be used for example to define macros (using #define directives) in every source files without having to define them in the Polyspace project.
0 Comments
More Answers (0)
See Also
Categories
Find more on Run Settings 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!