HP aC++/HP C A.06.20 Release Notes
+check=globals
+check=truncate[:explicit|:implicit]
The following new suboptions have been added to the +check=bounds option:
+check=bounds:array
+check=bounds:pointer
+check=bounds:all
+check=bounds:none
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.
New Features in Version A.06.15 23