C only


Adds the corresponding source code lines to the diagnostic messages in the stderr file.


Read syntax diagramSkip visual syntax diagram        .-nosrcmsg-.
>>- -q--+-srcmsg---+-------------------------------------------><

See also #pragma options.


The compiler reconstructs the source line or partial source line to which the diagnostic message refers and displays it before the diagnostic message. A pointer to the column position of the error may also be displayed. Specifying -qnosrcmsg suppresses the generation of both the source line and the finger line, and the error message simply shows the file, line and column where the error occurred.

The reconstructed source line represents the line as it appears after macro expansion. At times, the line may be only partially reconstructed. The characters "...." at the start or end of the displayed line indicate that some of the source line has not been displayed.

The default (-qnosrcmsg) displays concise messages that can be parsed. Instead of giving the source line and pointers for each error, a single line is displayed, showing the name of the source file with the error, the line and character column position of the error, and the message itself.


To compile myprogram.c so that the source line is displayed along with the diagnostic message when an error occurs, enter:

xlc myprogram.c -qsrcmsg

Related information