maxerr

Applies to C Applies to C++

Purpose

Instructs the compiler to halt compilation when num errors of a specified severity level or higher is reached.

Syntax


Syntax Diagram

where num must be an integer. Choices for severity level can be one of the following:


sev_level Description
i Informational
w Warning
e Error (C only)
s Severe error

Notes

If a severity level is not specified, the current value of the -qhalt option is used.

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.

An unrecoverable error occurs when the number of errors reached the limit specified. The error message issued is similar to:

1506-672 (U) The number of errors has reached the limit of ...

If -qnomaxerr is specified, the entire source file is compiled regardless of how many errors are encountered.

Diagnostic messages may be controlled by the -qflag option.

Examples

  1. To stop compilation of myprogram.c when 10 warnings are encountered, enter the command:
    xlc myprogram.c -qmaxerr=10:w
    
  2. 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
    
  3. 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 References

Compiler Command Line Options
flag
halt
Message Severity Levels and Compiler Response IBM Copyright 2003