Main Content

-custom-target

Create a custom target processor with specific data type sizes

Syntax

-custom-target target_sizes

Description

-custom-target target_sizes defines a custom target processor for the Polyspace® analysis. The target processor definition includes sizes in bytes of fundamental data types, signedness of plain char, alignment of structures and underlying types of standard typedef-s such as size_t, ptrdiff_t and wchar_t.

target_sizes is a comma-separated list specifying these values. From left to right, the values are the following. If a data type is not supported, -1 is used for its size.

SpecificationPossible Values
Whether plain char is signedtrue or false

Size of char in bits

Other sizes are in bytes.

Number
Size of shortNumber
Size of intNumber
Size of short long

Number

Size of longNumber
Size of long longNumber
Size of floatNumber
Size of doubleNumber
Size of long doubleNumber
Size of pointerNumber
Minimum alignment of all integer typesNumber
Minimum alignment of variables of type struct or unionNumber
Endiannesslittle or big
Underlying type of size_tunknown, unsigned_char, unsigned_short, unsigned_int, unsigned_long, or unsigned_long_long
Underlying type of ptrdiff_tunknown, signed_char, short, int, long, or long_long
Underlying type of wchar_tunknown, short, unsigned_short, int, unsigned_int, long, or unsigned_long

Typically, this option is used when the polyspace-configure command creates an options file for the subsequent Polyspace analysis. However, you can directly enter this option when manually writing options files. This option is useful in situations where your target specifications are not covered by one of the predefined target processors. See Target processor type (-target).

If you are running an analysis from the user interface (Polyspace desktop products only), on the Configuration pane, you can enter this option in the Other field. See Other.

Examples

An usage of the option looks like this:

-custom-target false,8,2,4,-1,4,8,4,8,8,4,8,1,little,unsigned_int,int,unsigned_int
The option argument translates to the following target specification.

SpecificationPossible Values
Whether plain char is signedfalse
Size of char8 bits
Size of short2 bytes
Size of int4 bytes
Size of short longshort long is not supported.
Size of long4 bytes
Size of long long8 bytes
Size of float4 bytes
Size of double8 bytes
Size of long double8 bytes
Size of pointer4 bytes
Maximum alignment of all integer types8 bytes
Maximum alignment of variables of type struct or union1 byte
Endiannesslittle
Underlying type of size_tunsigned_int
Underlying type of ptrdiff_tint
Underlying type of wchar_tunsigned_int

Tips

  • If your configuration uses both -custom-target and Target processor type (-target) to specify targets, the analysis uses the target that you specify with -custom-target.

  • If you use Polyspace as You Code extensions in IDEs, enter this option in an analysis options file. See options file.