Static checking options

Option

Default

-static-checking

yes

Enables instrumentation for array bounds checking of static data.

In the default mode, -static-checking=yes, Purify looks first in the .purify directive files for static-checking directives for a given object file, then it checks the command-line options. If Purify does not find any static checking options, it defaults to instrumenting in safe mode with a guard zone of 16 bytes.

If you specify -static-checking=no, static checking is completely disabled, regardless of whether you specify Purify directives for a given object file.

 

 

-static-checking-guardzone

16

Sets the size of the guard zone inserted between variables in the data section. The default value is 16 bytes; however, for arrays of large structures, this value can be too small to catch a reference beyond the last element.

To set the guard zone for specific files, add the following directive to a .purify file:

static_checking_guardzone <integer value> <filename>

You can include wildcard characters in <filename>. For example: program*.o matches /dira/dirb/program.o, /dira/dirb/program1.o, and program4.o.

For an illustration of how you can use .purify files for directives (suppression directives in this case), click .

Note:

  • The size of the guard zone affects the way a file is instrumented. To change the guard zone size of a file that is already instrumented, you need to relink your program to cause it to be reinstrumented with the new guard zone size. To cause your entire program to be reinstrumented with the new guard zone size, use the -force-rebuild option.

 

-static-checking-default

safe

Controls the default behavior of static checking in the absence of specific entries in directive files.

If never is specified, static checking is disabled.

If minimal is specified, Purify inserts guard zones only at the beginning and end of the data section for a given object file.

If the default safe is specified, Purify inserts guard zones only between data variables if there are no data section relative relocations. If an object file contains a data section relative relocation, Purify instruments that file in minimal mode.

If aggressive is specified, Purify inserts guard zones between data variables even if it finds data section relative relocations. However, the relocations must be to addresses that correspond to a known data variable.

To control the behavior of static checking for specific object files, add the following directive to a .purify file:

static_checking [never|minimal|safe|aggressive] <filename>

You can include wildcard characters in <filename>.

For an illustration of how you can use .purify files for directives (suppression directives in this case), click .

For information about how Purify checks static memory, click