2.4 Compiling a Program Containing C Preprocessor Directives Using kf77

If your Fortran program contains C preprocessor directives and you do not want to use any additional C preprocessor directives in the kf77 command line, use the DEC Fortran compiler switch -cpp , as follows:

kf77 -cpp myprog.f

The -cpp switch causes the C preprocessor to run on your Fortran program before compilation.

In the event you want to use C preprocessor directives in the kf77 command line, you must also include the C preprocessor switch -C to avoid errors resulting from C comment lines. For example, in the following kf77 command line where -Dfoo is a C preprocessor switch, you must include -C , as follows:

kf77 -cpp -C -Dfoo myprog.f

The kf77 driver does not set the -C switch when you use C preprocessor directives in the command line. Without the -C switch an error message results from the following program lines:

    PRINT 5
  5   FORMAT(//,'above are 2 blank lines')
      end


Previous Page|Next Page|Contents|Index|
Command-Line Switches

Copyright © Digital Equipment Corporation. 1997. All Rights Reserved.