-qmaxerr

Category

Error checking and debugging

Pragma equivalent

None.

Purpose

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

Syntax

Read syntax diagramSkip visual syntax diagram
-qmaxerr syntax — C

        .-nomaxerr------------------------.   
>>- -q--+-maxerr--=--number--+----------+-+--------------------><
                             |    .-s-. |     
                             '-:--+-i-+-'     
                                  +-w-+       
                                  '-e-'       

Read syntax diagramSkip visual syntax diagram
-qmaxerr syntax — C++

        .-nomaxerr------------------------.   
>>- -q--+-maxerr--=--number--+----------+-+--------------------><
                             |    .-s-. |     
                             '-:--+-i-+-'     
                                  '-w-'       

Defaults

-qnomaxerr: The compiler continues to process as much input as possible, until it is not able to generate code.

Parameters

number
Must be an integer with a value of 1 or greater. An unrecoverable error occurs when the number of errors reaches the limit specified, and compilation stops.
i
Specifies a minimum severity level of Informational (I).
w
Specifies a minimum severity level of Warning (W).
C only e
Specifies a minimum severity level of Error (E).
s
Specifies a minimum severity level of Severe error (S).

If you specify -qmaxerr with no severity level and the -qhalt option or pragma is also in effect, the severity level specified by halt is used. If you specify -qmaxerr with no severity level and halt is not in effect, the default severity level is s.

Usage

If the -qmaxerr option is specified more than once, the -qmaxerr option specified last determines the action of the option. If both the -qmaxerr and -qhalt options are specified, the -qmaxerr or -qhalt option specified last determines the severity level used by the -qmaxerr option.

Diagnostic messages may be controlled by the -qflag option.

Predefined macros

None.

Examples

To stop compilation of myprogram.c when 10 warnings are encountered, enter the command:
xlc myprogram.c -qmaxerr=10:w
To stop compilation of myprogram.c when 5 severe errors are encountered, assuming that the current -qhalt option value is s (severe), enter the command:
xlc myprogram.c -qmaxerr=5
To stop compilation of myprogram.c when 3 informational messages are encountered, enter the command:
xlc myprogram.c -qmaxerr=3:i
or:
xlc myprogram.c -qmaxerr=3 -qhalt=i

Related information