Extra C flags
Specify C compilation flags required for building project
Since R2023b
Description
Specify C compilation flags required for building project. Use this option to enter compiler flags that you cannot enter through the other options. These flags are not used during static analysis.
You might be using compiler specific flags to build your C code. Typical compilers flags
can be specified in a Polyspace Platform project by using options such as Include
Paths, Libraries, Preprocessor definitions (-D). If
you cannot specify your compiler flags using existing options, then enter the flags directly
in this field. These compiler flags are then passed to the compilation tool chain when it
build your source code and tests. These flags are not relevant for static analysis.
Set Option
In your Polyspace Platform project configuration, on the Build tab, enter compilation flags for this option on the Target & Compiler node.
Why Use This Option
If you use a compiler specific flag to correctly build your C code, then Polyspace®
Test™ must use the same flags to invoke the compiler specified in Compilation
toolchain (Testing). If none of the options in the Target &
Compiler node can accurately represent the required compiler flag, then
specify the compiler flags directly as input to this option.
Settings
Specify the extra flags in the text box. The flags you specify are appended to the build command that Polyspace Test uses to build the project.
The Polyspace Test build command is not identical to the build command that you use to build your project. The extra flags that you add might conflict with flags implicitly added to the build command and produce unexpected results. If you see unexpected build errors, check the Logs pane to review the full build command that Polyspace Test uses to build the project.
Command-Line Information
The command-line workflow for setting this option depends on your workflow.
If you build your source and tests using a Polyspace Platform Project — Once you set this option in the project using the Polyspace Platform user interface, you cannot override or modify this option using the
polyspace-testcommand.If you build your sources and xUnit tests using your own toolchain — You can provide the extra C flags directly to your compiler as part of your build command.
Tips
If you have a build command that you use to build your source code, create your project
(.psprjx) directly by using this build command. See Create Project and Add Source Files in Polyspace Platform User Interface
Version History
Introduced in R2023b