Hauptinhalt

Konfigurieren von Quellen und Build-Optionen

R2026b
Konfigurieren von Polyspace, um den Build präzise nachzubilden

Wenn Sie zum Erstellen Ihres Quellcodes einen Build-Befehl wie make oder cmake verwenden oder mit Ihrem Build-System eine JSON-Kompilierdatenbank erzeugen können, können Sie aus dem Build-Befehl oder der Kompilierdatenbank ein Polyspace®-Plattform-Projekt erstellen. Die Quelldateien und Build-Optionen im Polyspace-Plattform-Projekt werden anhand der Compileraufrufe im Build-Befehl bzw. in der Kompilierdatenbank ermittelt.

Andernfalls legen Sie die Optionen explizit in Ihrer Build-Konfiguration fest. Wenn Sie für die Option Compilation toolchain (Static Analysis) Ihren Compiler angeben, kann der Analysator compilerspezifische Schlüsselwörter erkennen. Umgehen Sie buildbezogene Analysefehler mit Optionen wie Preprocessor definitions (-D) oder Command/script to apply to preprocessed files (-post-preprocessing-command).

Funktionen

polyspace-configure(System Command) Create Polyspace Platform project, workspace, or options file from build command or compilation database

Polyspace-Optionen

alle erweitern

Application source files (-sources, -sources-list-file)Add source files to Polyspace Platform project
Application source foldersAdd source folders to Polyspace Platform project (Seit R2024a)
Include paths (-I)Specify paths to folders containing include files
Include file name patternsSpecify patterns for file names to be included in Polyspace Platform project (Seit R2024a)
Exclude patternsSpecify folders or files to be excluded from static analysis or testing (Seit R2024a)
Project variablesDefine environment variables for use as shorthands in Polyspace Platform project (Seit R2024a)
Quellcode-Sprache (-lang)Specify language of source files
C Standard-Version (-c-version)Specify C language standard followed in source code
C++ Standard-Version (-cpp-version)Specify C++ language standard followed in source code
Compilation toolchain for static analysis (-compiler, -compiler -target)Specify the compiler that you use to build your source code for static analysis
Processor (-custom-target)Select the processor for the current build configuration
-targetSpecify size of data types and endianness by selecting a predefined target processor or creating a custom processor
Stop analysis if a file does not compile (-stop-if-compile-error)Specify that a compilation error must stop the analysis
Implicit C(C++) compiler include pathsView implicit compiler include paths extracted from your build command (Seit R2024b)
Implicit C(C++) compiler definesView implicit compiler defines extracted from your build command (Seit R2024b)
Source code encoding (-sources-encoding)Specify the encoding of source files
-sfr-typesSpecify sizes of sfr types for code developed with Keil or IAR compilers
-no-uliteralsDisable Polyspace definitions for char16_t or char32_t
-ignore-pragma-packIgnore #pragma pack directives
Preprocessor definitions (-D)Replace macros in preprocessed code
Disabled preprocessor definitions (-U)Undefine macros in preprocessed code
Command/script to apply to preprocessed files (-post-preprocessing-command)Specify command or script to run on source files after preprocessing phase of analysis
Implicit C(C++) compiler definesView implicit compiler defines extracted from your build command (Seit R2024b)
-regex-replace-rgx -regex-replace-fmtMake replacements in preprocessor directives
-dump-preprocessing-infoShow all macros implicitly defined during a particular analysis
Include paths (-I)Specify paths to folders containing include files
Additional include paths (-I)Specify build-specific include paths in addition to project-wide include paths (Seit R2024a)
Forced includes (-include)Specify files to be #include-d by every source file. (Seit R2023b)
Implicit C(C++) compiler include pathsView implicit compiler include paths extracted from your build command (Seit R2024b)
Code from DOS or Windows file system (-dos)Consider that file paths are in MS-DOS style
-includeSpecify files to be #include-ed by each C file in analysis
Round down results of negative integer division (-div-round-down)Specify that your compiler rounds down a negative quotient from dividing two integers (Seit R2023b)
Pack alignment value (-pack-alignment-value)Specify default structure packing alignment for code developed in Visual C++
Shift right on signed integers as arithmetic shift (-logical-signed-right-shift)Specify that your compiler implements right shifts on signed integers as arithmetic shifts (Seit R2023b)
Enum type definition (-enum-type-definition)Specify how to represent an enum with a base type
-options-for-sourcesSpecify analysis options specific to a source file
NameSee name of Polyspace Platform project (Seit R2024a)

Themen

Erste Schritte

Konfigurieren von Optionen mit Build-Befehlen

Manuelles Konfigurieren von Optionen

Unterstützung für C/C++ Sprachstandards und Erweiterungen