HP aC++/HP ANSI C A.06.27 Release Notes
Descriptions:
• +check=globals
The +check=globals option enables runtime checks to detect corruption of global variables
by introducing and checking "guards" between them, at the time of program exit. Setting
environment variable RTC_ROUTINE_LEVEL_CHECK will also enable the check whenever a
function compiled with this option returns.
For this purpose, the definition of global is extended to be all variables that have static storage
duration, including file or namespace scope variables, function scope static variables, and
class (or template class) static data members.
The +check=globals option is implied by +check=all.
• +check=truncate[:explicit|:implicit]
The +check=truncate option enables runtime checks to detect data loss in assignment
when integral values are truncated. Data loss occurs if the truncated bits are not all the same
as the left most non-truncated bit for signed type, or not all zero for unsigned type. Programs
may contain intentional truncation at runtime, such as when obtaining a hash value from a
pointer or integer. To avoid runtime failures on these truncations, the user can explicitly mask
off the value: ch = (int_val & 0xff);
explicit Turns on runtime checks for truncation on explicit user casts of integral values,
such as (char)int_val.
implicit Turns on runtime checks for truncation on compiler-generated implicit type
conversions, such as ch = int_val;.
+check=truncate (with no suboptions) turns on runtime checks for both explicit cast and
implicit conversion truncation
Note that the +check=all option does not imply +check=truncate. To enable
+check=truncate, you must explicitly specify it.
• +check=bounds[:array|pointer|all|none]
The +check=bounds option has been enhanced to provide the option of checking for
out-of-bound references to buffers through pointer access as well as to array variables. 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. This check can create significant run-time
performance overhead.
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, +check=bounds:pointer must be specified explicitly.
-Bhidden_def (New)
-Bhidden_def
This option is the same as -Bhidden, but only locally defined (non-tentative) symbols, without
__declspec(dllexport), are assigned the hidden export class.
New features in version A.06.15 35