主要内容

-wchar-t-type-is

指定 wchar_t 的基础数据类型

描述

显式指定 wchar_t 的基础数据类型。如果您未指定此选项,则基础类型将由您所选的编译器决定。

设置选项

使用以下方法之一设置选项:

  • Polyspace 平台用户界面(仅限桌面端产品):在 Polyspace® 平台用户界面中,此选项不是直接可用的。在您的工程配置中,在编译选项卡上,选择目标和编译器,然后为处理器选项配置设置。在编辑处理器对话框中,为 wchar_t 的类型选项选择一个值。有关详细信息,请参阅处理器

  • 命令行和选项文件:请使用 -wchar-t-type-is 选项。请参阅命令行信息

为何使用此选项

当您指定编译器时,分析会为 wchar_t 关联一种数据类型。如果您使用会更改此默认类型的编译器选项,请通过此分析选项模拟您的编译器选项。

设置

默认值: defined-by-compiler

defined-by-compiler

您对编译工具链(静态分析) 的设定决定 wchar_t 的基础类型。

signed-short

分析将 signed short 视为 wchar_t 的基础类型。

unsigned-short

分析将 unsigned short 视为 wchar_t 的基础类型。

signed-int

分析将 signed int 视为 wchar_t 的基础类型。

unsigned-int

分析将 unsigned int 视为 wchar_t 的基础类型。

signed-long

分析将 signed long 视为 wchar_t 的基础类型。

unsigned-long

分析将 unsigned long 视为 wchar_t 的基础类型。

命令行信息

参数:-wchar-t-type-is
值:defined-by-compiler | signed-short | unsigned-short | signed-int | unsigned-int | signed-long | unsigned-long
默认值:defined-by-compiler
示例 (Bug Finder):polyspace-bug-finder -wchar-t-type-is signed-int
示例 (Code Prover):polyspace-code-prover -wchar-t-type-is signed-int
示例 (Bug Finder Server):polyspace-bug-finder-server -wchar-t-type-is signed-int
示例 (Code Prover Server):polyspace-code-prover-server -wchar-t-type-is signed-int