HP aC++/HP C A.06.25 Programmer's Guide

The -z option, which is part of +check=all, can be overridden by an explicit -Z
option.
+check=none
The +check=none option turns off all runtime checking options. It disables any
+check=xxxoptions that appear earlier on the command line.
+check=bounds
The +check=bounds option enables checks for out-of-bounds references to array
variables or to buffers through pointer access. The check is performed for each reference
to an array element or pointer access. If a check fails, an error message is emitted and
the program is aborted.
The +check=bounds option applies only to local and global array variables. It also
applies to references to array fields of structs. It does not apply to arrays allocated
dynamically using malloc or alloca.
You can specify one of the following +check=bounds suboptions:
array - Enables check for out-of-bounds references to array variables.
pointer - Enables check for out-of-bounds references to buffers through pointer
access. The buffer could be a heap object, global variable, or local variable. This
suboption also checks out-of-bounds access through common libc function calls
such as strcpy, strcat, memset, and so on. The check can create significant
run-time performance overhead. See +check=uninit and +check=malloc for
their interaction with this option.
all - Enables out-of-bounds checks for both arrays and pointers. This is equal to
+check=bounds:array +check=bounds:pointer.
none - Disables out-of-bounds checks.
+check=bounds (with no suboption) is equal to +check=bounds:array. This may
change in the future to also include +check=bounds:pointer.
When +check=all is specified, it enables +check=bounds:array only. To enable
the pointer out-of-bounds check, you must explicitly specify
+check=bounds:pointer.
You can combine +check=bounds:[pointer | all] with all other +check options,
except for +check=globals (which would be ignored in this case).
Also see the +check=malloc and the +check=stack options for related runtime
checks for heap and stack objects.
Example:
This example uses +check=bounds:pointer to find a program bug:
$ cat rttest3.c 1 #include <stdio.h>
2 #include <memory.h>
3 #include <stdlib.h>
102 Command-Line Options