配置源代码和编译选项
配置 Polyspace 以精确模拟您的编译
如果您使用 make 或 cmake 等编译命令来编译源代码,或者如果您能够使用编译系统生成 JSON 编译数据库,则可以从编译命令或编译数据库创建一个 Polyspace® 平台工程。Polyspace 平台工程中的源文件和编译选项由编译命令或编译数据库中的编译器调用决定。
否则,请在编译配置中显式设置选项。通过为编译工具链(静态分析) 选项指定编译器,可使分析器识别编译器特定的关键字。使用预处理器定义 (-D) 或要应用于预处理文件的命令/脚本 (-post-preprocessing-command) 等选项来解决任何与编译相关的分析错误。
函数
polyspace-configure | (系统命令)从 DOS 或 UNIX 命令行中的编译系统创建 Polyspace 工程 |
Polyspace 选项
主题
快速入门
- 指定目标环境和编译器行为
了解指定目标和编译器选项的工作流。 - Information Gathered From Build Systems for Polyspace Analysis and Testing
Learn what information is extracted when you trace your build command to create a Polyspace Platform project.
使用编译命令配置选项
- Create Polyspace Platform Project From Build Command in User Interface
Create a project in the Polyspace Platform user interface from a working build command or compilation database. - 从编译系统创建 Polyspace 工程的要求
了解为什么自动创建 Polyspace 工程可能不适用于您的编译系统,以及如何解决一些原因。 - 使用模式匹配选择用于 Polyspace 工程的文件
使用带有 glob 模式的表达式选择要包含在 Polyspace 工程或选项文件中的文件。 - 从编译命令 (makefile) 创建 Polyspace 分析配置
重复使用编译命令 (makefile) 来配置 Polyspace 分析。 - Modularize Polyspace Projects by Using Makefile Builds
Create a separate Polyspace project or options file for each binary in makefile build. - Create Polyspace Platform Projects From IDE Builds
Specify source files and configuration options by tracing your Visual Studio® build. - Create Polyspace Platform Projects from CMake Builds
Reuse build information in CMakeLists files for Polyspace analysis and testing.
手动配置选项
- 指定目标环境和编译器行为
了解指定目标和编译器选项的工作流。 - 为 Polyspace 分析提供标准库头文件
从编译器中找到 C 或 C++ 标准库头文件的路径,并在 Polyspace 工程中指定这些路径。 - Remove or Replace Keywords Before Compilation
Replace or remove keywords from preprocessed code to avoid compilation errors. - Gather Compilation Options Efficiently for Polyspace Analysis
Put workarounds for compilation errors into a single file and include that file in analysis.
对 C/C++ 语言标准和扩展的支持
- C/C++ Language Standard Used in Polyspace Analysis
See supported language standards and the default standard used in Polyspace analysis.
- Keil or IAR Language Extensions Supported with Polyspace
Find which Keil or IAR-specific extensions of the C language standard are supported for verification.