Diagnostics for compile-time errors

A basic recommendation for a porting project is to compile the application with the option -qinfo=por. This suboption of -qinfo adds diagnostic messages that pertain specifically to portability. The option -qinfo=warn64 instructs the compiler to emit diagnostic messages specific to porting an application to 64-bit mode. These messages can help to narrow the scope of investigation or to pinpoint a particular coding construct.

The following table shows other options that can be helpful for detecting and correcting compile-time errors.

Other diagnostic options for compile-time errors
Option Description
-qsrcmsg Prints to standard error the source line that the compiler believes to contain the error, a line below it pointing to a particular spot in that source line, and the diagnostic message.
-qsource Requests a compiler listing to be returned. The various sections of a listing include the source code with line numbers, the options specified, a listing of all files used in the compilation, a summary of the diagnostic messages by severity level, the number of lines read, and whether or not the compilation was successful. The attribute and cross-reference section of a listing can be produced by specifying the -qattr and -qxref options, respectively. The object section, which requires specifying the option -qlist, shows the pseudo assembly code generated by the compiler and is used for diagnosing execution time problems in cases where you suspect the program is not performing as expected due to code generation errors.
-qsuppress Stops particular messages from being emitted by the compiler. You can suppress more than one message by listing the message numbers in a colon separated list.
-qflag Stops specified diagnostic messages from being emitted to the terminal and the listing file. The option uses the single-letter severity codes of the default compiler message format to specify the level below which messages should be ignored.
IBM Copyright 2003