Error checking and debugging

The options in this category allow you to detect and correct problems in your source code. In some cases, these options can alter your object code, increase your compile time, or introduce runtime checking that can slow down the execution of your application. The option descriptions indicate how extra checking can impact performance.

To control the amount and type of information you receive regarding the behavior and performance of your application, consult the options in Listings, messages, and compiler information.

For information on debugging optimized code, see the XL C/C++ Optimization and Programming Guide.

Table 1. Error checking and debugging options
Option name Equivalent pragma name Description
-# (pound sign) None.

Previews the compilation steps specified on the command line, without actually invoking any compiler components.

-qcheck #pragma options check

Generates code that performs certain types of runtime checking.

-qflttrap #pragma options flttrap

Determines the types of floating-point exception conditions to be detected at run time

-qformat None.

Warns of possible problems with string input and output format specifications.

-qfullpath #pragma options fullpath

When used with the -g or -qlinedebug option, this option records the full, or absolute, path names of source and include files in object files compiled with debugging information, so that debugging tools can correctly locate the source files.

-qfunctrace None.

Calls to the tracing routine that traces the entry and exit points of functions in a compilation unit, or only a specific list of functions.

-g None.

Generates debug information for use by a symbolic debugger.

-qhalt #pragma options halt

Stops compilation before producing any object, executable, or assembler source files if the maximum severity of compile-time messages equals or exceeds the severity you specify.

-qhaltonmsg (C++ only) None.

Stops compilation before producing any object, executable, or assembler source files if a specified error message is generated.

-qinfo #pragma options info, #pragma info

Produces or suppresses groups of informational messages.

-qinitauto #pragma options initauto

Initializes uninitialized automatic variables to a specific value, for debugging purposes.

-qkeepparm None.

When used with -O2 or higher optimization, specifies whether function parameters are stored on the stack.

-qlinedebug None.

Generates only line number and source file name information for a debugger.

-qmaxerr None.

Halts compilation when a specified number of errors of a specified severity level or higher is reached.

-qoptdebug None.

When used with high levels of optimization, produces files containing optimized pseudocode that can be read by a debugger.

-qsymtab (C only) None.

Determines the information that appears in the symbol table.

-qsyntaxonly (C only) None.

Performs syntax checking without generating an object file.

-qwarn0x (C++0x) None.

Controls whether to inform users with messages about differences in their programs caused by migration from the C++98 standard to the C++0x standard.

-qwarn64 None.

Enables checking for possible data conversion problems between 32-bit and 64-bit compiler modes.