Configuring TICSc

Type sizes

For some rules, it is necessary to know the type sizes. In C, the type sizes for short, int and long are implementation defined. This allows compiler makers to optimize for certain architectures. Typically, the size of int is mapped to the native word size of the target architecture for maximum processing speed.

For example, for a 32 bit architecture, type sizes would be (in bytes):

typesize
short2
int4
long4

Table 1 Typical type sizes (in bytes) for 32 bit architectures.

However, for a 16 bit architecture, type sizes could be (in bytes):

typesize
short2
int2
long4

Table 2 Typical type sizes (in bytes) for 16 bit architectures.

By default, TICSc uses the type sizes from Table 1. It is possible to specify different type sizes by creating a file named typesizes.txt in the TICS configuration directory. An example of the contents of the typesizes.txt file is given below.

// type sizes of ISO standard types in bytes
short:2
int:4
long:4

The format is line based. Blank lines and lines starting with // are ignored. Other lines should contain the type name (short, int or long) and its size in bytes, separated by a colon (:).