-qsource

Category

Listings, messages, and compiler information

Purpose

Produces a compiler listing file that includes the source section of the listing and provides additional source information when printing error messages.

Syntax

Read syntax diagramSkip visual syntax diagram
        .-nosource-.   
>>- -q--+-source---+-------------------------------------------><

@PROCESS:

@PROCESS SOURCE | NOSOURCE

Defaults

-qnosource

Usage

This option displays on the terminal each source line where the compiler detects a problem, which can be very useful in diagnosing program errors in the Fortran source files.

You can selectively print parts of the source code by using SOURCE and NOSOURCE in @PROCESS directives in the source files around those portions of the program you want to print. This is the only situation where the @PROCESS directive does not have to be before the first statement of a compilation unit.

Examples

In the following example, the point at which the incorrect call is made is identified more clearly when the program is compiled with the -qsource option:
$ cat argument_mismatch.f
         subroutine mult(x,y)
         integer x,y
         print *,x*y
         end

         program wrong_args
         interface
                 subroutine mult(a,b)   ! Specify the interface for this
                         integer a,b    ! subroutine so that calls to it
                 end subroutine mult    ! can be checked.
         end interface
         real i,j
         i = 5.0
         j = 6.0
         call mult(i,j)
         end
$ xlf95 argument_mismatch.f
** mult   === End of Compilation 1 ===
"argument_mismatch.f", line 15.20: 1513-061 (S) Actual argument attributes
do not match those specified by an accessible explicit interface.
** wrong_args  === End of Compilation 2 ===
1501-511  Compilation failed for file argument_mismatch.f.
$ xlf95 -qsource argument_mismatch.f
** mult   === End of Compilation 1 ===
        15 |   call mult(i,j)
            ............a...
a - "argument_mismatch.f", line 15.20: 1513-061 (S) Actual argument attributes do not match those 
specified by an accessible explicit interface.
** wrong_args   === End of Compilation 2 ===
1501-511  Compilation failed for file argument_mismatch.f.

Related information