Intel® C++ Compiler Classic Developer Guide and Reference

ID 767249
Date 12/16/2022
Public

A newer version of this document is available. Customers should click here to go to the newest version.

Document Table of Contents

Pointer Checker Feature Summary

The pointer checker is not supported on macOS 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:

  • none: Disables the pointer checker (default).

  • write: Checks bounds for only writes through pointers.

  • rw: Checks bounds for 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 ], where:

  • none: Disables checking for dangling pointer references (default).

  • heap: Checks for dangling pointer references on the heap.

  • stack: Checks for dangling pointer references on the stack.

  • all: Checks for dangling pointer references on both the heap and the stack.

NOTE:

To use this option, you must also use the [Q]check-pointers compiler option.

This option cannot be used with [Q]check-pointers-mpx.

See Checking for Dangling Pointers.

[Q]check-pointers-undimensioned

Enables the checking of bounds for arrays without dimensions.

NOTE:

To 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.

NOTE:

To use this option, you must also use the [Q]check-pointers compiler option.