Intel® C++ Compiler 16.0 User and Reference Guide
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 |
Enables the pointer checker and adds the associated libraries. This compiler option enables checking of all indirect accesses through pointers and accesses to arrays. The possible option keywords are [ none | write | rw ], where:
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 ], where:
NoteTo use this option, you must also use the [Q]check-pointers compiler option. This option cannot be used with [Q]check-pointers-mpx. |
[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. |
[Q]check-pointers-narrowing |
Determines whether the compiler enables or disables the narrowing of pointers to structure fields. Narrowing restricts a field pointer so that it can only legally point to that field. Enables or disables the compiler narrowing of pointers to structure fields. The default is enabled for narrowing pointer references. Disabling this feature can improve Pointer Checker compatibility with non-ANSI compliant code. To disable the narrowing of pointers to structure fields, specify the negative form of the option. NoteTo use this option, you must also use the [Q]check-pointers compiler option. NoteThis pointer checker feature requires installation of another product. For more information, see Feature Requirements. |
check-pointers-mpx, Qcheck-pointers-mpx |
Determines whether the compiler checks bounds for memory access through pointers on processors supporting Intel® Memory Protection Extensions (Intel® MPX). It enables checking of all indirect accesses through pointers, and all array accesses. Specifies what type of bounds checking occurs. The possible option keywords are [ none | write | rw ], where:
The compiler may optimize these checks away when it can determine that an access is safe. This option cannot be used with [Q]check-pointers-dangling. If you specify option [Q]check-pointers along with option [Q]check-pointers-mpx, [Q]check-pointers-mpx takes precedence. NoteThis pointer checker feature requires installation of another product. For more information, see Feature Requirements. |
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 in the <install-dir>\include directory. |