User and Reference Guide for the Intel® C++ Compiler 14.0
The pointer checker is not supported on OS X* systems.
The pointer checker provides a number of related elements, summarized in the following table.
| Element | Description |
| Compiler Options: | |
|
[Q]check-pointers [Q]check-pointers-mpx |
Enables the pointer checker and adds the associated libraries. These compiler options enable checking of all indirect accesses through pointers and accesses to arrays. The [Q]check-pointers-mpx option will generate code which uses the Intel® Memory Protection Extensions (Intel® MPX) for performance acceleration. On systems without Intel® MPX, the pointer checker features will not function, but the application will execute normally. If both options are set, [Q]check-pointers-mpx will take preference. The option keywords are [none | write | rw]. The pointer checker is off by default. Specify none to disable the pointer checker. Specify write to check bounds for writes through pointers only. Specify rw to check bounds for both reads and writes through pointers. If the compiler determines that an access is safe during optimization, then the compiler removes the pointer checking code. See Checking Bounds. |
|
[Q]check-pointers-dangling |
Enables checking for dangling pointer references. The possible option keywords are [none | heap | stack | all]. NoteTo use this option, you must also use the [Q]check-pointers compiler option. This option may not be used with the [Q]check-pointers-mpx compiler option. The default is no checking for dangling pointer references. Specify none to disable checking for dangling pointer references. Specify heap to check for dangling pointer references on the heap. Specify stack to check for dangling pointer references on the stack. Specify all to check for dangling pointer references on both the heap and the stack. |
|
[Q]check-pointers-undimensioned |
Enables the checking of bounds for arrays without dimensions. NoteTo use this option, you must also use the [Q]check- pointers compiler option. See Checking Arrays. |
| Intrinsics: | |
| void * __chkp_lower_bound(void **) |
Returns the lower bound associated with the pointer. See Writing a Wrapper. |
| void * __chkp_upper_bound(void **) |
Returns the upper bound associated with the pointer. See Writing a Wrapper. |
| void * __chkp_kill_bounds(void *p) |
Removes the bounds information to allow the pointer specified in the argument to access all memory. Use this function for a pointer from a non-enabled module that will be used in an enabled module where you cannot determine the bounds of the pointer. The function ensures that the pointer created from a non-enabled module does not inherit the bounds from another pointer that was in the same memory address. The return value is a pointer without bounds information. |
|
void * __chkp_make_bounds(void *p, size_t size) |
Creates new bounds information within the allocated memory address for the pointer in the argument, replacing any previously associated bounds information. The new bounds are: p = __chkp_make_bounds(q, size) // lower_bound(p) = (char *)q // upper_bound(p) = lower_bound(p) + size |
| Reporting Function: | |
| void __chkp_report_control(__chkp_report_option_t option, __chkp_callback_t callback) |
Determines how errors are reported. |
| Enumeration: | |
|
__chkp_report_option_t |
Controls how out-of-bounds error are reported. This enumeration is declared in the header file chkp.h. |
| Environment Variable: | |
|
INTEL_CHKP_REPORT_MODE |
Changes the pointer checker reporting mode at runtime. |
| Header file: | |
|
chkp.h |
Defines intrinsic and reporting functions. The header file is located n the <install-dir>\include directory. |