-lang)Specify language of source files
Specify the language of your source files. Before specifying other configuration options, choose this option because other options change depending on your language selection.
If you add files during project setup, the language selection can change from the default.
| Files Added | Source Code Language |
|---|---|
Only files with extension .c | C |
Only files with extension .cpp or
.cc | CPP |
Files with extension .c,
.cpp, and .cc | C-CPP |
User interface (desktop products only): In your project configuration, the option is on the Target & Compiler node. See Dependencies for ways in which the source code language can be automatically determined.
Command line and options file: Use the option
-lang. See Command-Line Information.
Default: Based on file extensions.
CIf your project contains only C files, choose this setting. This value restricts the verification to C language conventions. All files are interpreted as C files, regardless of their file extension.
CPPIf your project contains only C++ files, choose this setting. This value restricts the verification to C++ language conventions. All files are interpreted as C++ files, regardless of their file extension.
C-CPPIf your project contains C and C++ source files, choose this setting. This
value allows for C and C++ language conventions. .c files
are interpreted as C files. Other file extensions are interpreted as C++
files.
The language option allows and disallows many options and option values. Some options change depending on your language selection. For more information, see the individual analysis option pages.
If you create a Polyspace® project or options file from your build system using the
polyspace-configure command or
polyspaceConfigure function, the value of this option is
determined by the file extensions.
For a project with both .c and .cpp
files, the language option C-CPP is used. During the
analysis, each file is compiled based on the language standard determined by the
file extensions. After the compilation, Polyspace verifies such mixed projects as C++ projects.
Parameter: -lang |
Value: c | cpp|
c-cpp |
| Default: Based on file extensions |
Example (Bug Finder):
polyspace-bug-finder -lang c-cpp -sources
|
Example (Code Prover):
polyspace-code-prover -lang cpp -sources
|
Example (Bug Finder):
polyspace-bug-finder -lang c -sources
|
Example (Code Prover):
polyspace-code-prover -lang c -sources
|
Example (Bug Finder Server):
polyspace-bug-finder-server -lang c -sources
|
Example (Code Prover Server):
polyspace-code-prover-server -lang c -sources
|