Intel® C++ Compiler XE 13.1 User and Reference Guides

ftrapuv, Qtrapuv

Initializes stack local variables to an unusual value to aid error detection.

IDE Equivalent

Windows: None

Linux: Run-Time > Initialize Stack Variables to an Unusual Value

OS X: Run-Time > Initialize Stack Variables to an Unusual Value

Architectures

All

Syntax

Linux and OS X:

-ftrapuv

Windows:

/Qtrapuv

Arguments

None

Default

OFF

The compiler does not initialize local variables.

Description

This option initializes stack local variables to an unusual value to aid error detection. Normally, these local variables should be initialized in the application.

The option sets any uninitialized local variables that are allocated on the stack to a value that is typically interpreted as a very large integer or an invalid address. References to these variables are then likely to cause run-time errors that can help you detect coding errors.

This option sets option -g (Linux* OS and OS X*) and /Zi or /Z7 (Windows* OS), which changes the default optimization level from O2 to -O0 (Linux OS and OS X) or /Od (Windows OS). You can override this effect by explicitly specifying an O option setting.

If option O2 and option -ftrapuv (Linux OS and OS X) or /Qtrapuv (Windows OS) are used together, you should specify option -fp-speculation safe (Linux OS and OS X) or /Qfp-speculation:safe (Windows OS) to prevent exceptions resulting from speculated floating-point operations from being trapped.

For more details on using options -ftrapuv and /Qtrapuv with compiler option O, see the article on Intel® Software Network titled Don't optimize when using -ftrapuv for uninitialized variable detection.

Alternate Options

None

See Also


Submit feedback on this help topic