Main Content

Block char16/32_t types (-no-uliterals)

Disable Polyspace definitions for char16_t or char32_t

Description

Specify that the analysis must not define char16_t or char32_t types.

Set Option

User interface (desktop products only): In your project configuration, the option is on the Target & Compiler node. See Dependencies for other options you must also enable.

Command line and options file: Use the option -no-uliterals. See Command-Line Information.

Why Use This Option

If your compiler defines char16_t and/or char32_t through a typedef statement or by using includes, use this option to turn off the standard Polyspace® definition of char16_t and char32_t.

To check if your compiler defines these types, save the following code in a C++ file and compile this code using the compiler settings that you typically use:

typedef unsigned short char16_t;
typedef unsigned long char32_t;

See if there is a compilation error.

  • If the file fails to compile with an error such as redeclaration of C++ built-in type, it means that your compiler has the types char16_t and char32_t defined as built-in types. Enable this Polyspace option to emulate your compiler behavior.

  • If the file compiles, it means that your compiler defines these types through typedef-s in includes. If you have already added those includes to your project, you do not need to enable this Polyspace option.

Settings

On

The analysis does not allow char16_t and char32_t types.

Off (default)

The analysis allows char16_t and char32_t types.

Dependencies

You can select this option only when these conditions are true:

Command-Line Information

Parameter: -no-uliterals
Default: off
Example (Bug Finder): polyspace-bug-finder -lang cpp -compiler gnu4.7 -cpp-version cpp11 -no-uliterals
Example (Code Prover): polyspace-code-prover -compiler gnu4.7 -lang cpp -cpp-version cpp11 -no-uliterals
Example (Bug Finder Server): polyspace-bug-finder-server -lang cpp -compiler gnu4.7 -cpp-version cpp11 -no-uliterals
Example (Code Prover Server): polyspace-code-prover-server -compiler gnu4.7 -lang cpp -cpp-version cpp11 -no-uliterals