-qmaxerr

Category

Error checking and debugging

Pragma equivalent

None.

Purpose

Stops compilation when the number of error messages of a specified severity level or higher reaches a specified number.

Syntax

Read syntax diagramSkip visual syntax diagram
-qmaxerr syntax — C

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

Defaults

-qnomaxerr

Parameters

number
It specifies the maximum number of messages the compiler generates before it stops. number must be an integer with a value of 1 or greater.
i
Specifies that the severity level is Informational (I) or higher.
w
Specifies that the severity level is Warning (W) or higher.
e
Specifies that the severity level is Error (E) or higher.
s
Specifies that the severity level is Severe (S).

Usage

If the -qmaxerr option does not specify the severity level, it uses the severity that is in effect by the -qhalt option; otherwise, the severity level is specified by either -qmaxerr or -qhalt that appears last.

Diagnostic messages can 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