Instructs the compiler to stop after the compilation phase when it encounters errors of specified severity or greater.


Read syntax diagramSkip visual syntax diagram                  (2)
               |  (1)     |
>>- -qhalt--=--+-i--------+------------------------------------><

  1. Default for C++ compilations.
  2. Default for C compilations.

where severity levels in order of increasing severity are:

severity Description
i Information
w Warning
e Error (C only)
s Severe error
u Unrecoverable error

See also #pragma options.


When the compiler stops as a result of the -qhalt option, the compiler return code is nonzero.

When -qhalt is specified more than once, the lowest severity level is used.

The -qhalt option can be overridden by the -qmaxerr option.

Diagnostic messages may be controlled by the -qflag option.


To compile myprogram.c so that compilation stops if a warning or higher level message occurs, enter:

xlc myprogram.c -qhalt=w

Related information