HP 3000 Manuals

Ch 8. Interfacing with Other Languages [ HP FORTRAN 77/iX Programmer's Guide ] MPE/iX 5.0 Documentation


HP FORTRAN 77/iX Programmer's Guide

Chapter 8  Interfacing with Other Languages 

This chapter describes how to call routines written in HP Pascal/iX, HP
COBOL/iX, or HP C/iX from an HP FORTRAN 77/iX program, and how to call an
HP FORTRAN 77/iX subroutine or function from HP Pascal/iX, HP COBOL/iX,
or HP C/iX.

If you call other languages from HP FORTRAN 77/iX, the actual parameters
of the internal procedure or function must match the formal parameters of
the external procedure or function.  The CHECK_ACTUAL_PARM compiler
option determines the level of the checking information placed in the
object file for the Link Editor when performing a LINK or ADDXL. Refer to
the HP FORTRAN 77/iX Reference Manual for more information on the
CHECK_ACTUAL_PARM compiler directive.

When calling HP FORTRAN 77/iX from other languages, you must match the
parameters appearing in the non-FORTRAN 77 program with the formal
parameters of the external FORTRAN 77 procedure or function.  The
CHECK_FORMAL_PARM compiler option determines the checking information
placed in the object file for the Link Editor when performing a LINK or
ADDXL. Refer to the HP FORTRAN 77/iX Reference Manual for more
information on the CHECK_FORMAL_PARM compiler option.

All parameters passed to an HP FORTRAN 77/iX subprogram must be passed by
reference.  By default, HP FORTRAN 77/iX passes parameters of all types
by reference, except for character data.  When passing character data, a
descriptor is passed that includes the address and length of the string.
HP FORTRAN 77/iX allows parameters to be passed by value to invoke
non-FORTRAN 77 program units that allow passing arguments by value.  When
passing parameters by value, the ALIAS compiler directive must indicate
how each parameter is passed.

HP FORTRAN 77/iX does not allow arrays to be passed by value.  Therefore,
an HP FORTRAN 77/iX program cannot call a non-FORTRAN 77 program unit
that requires an array parameter to be passed by value.  Also, when you
call functions that have no parameters, you must specify an empty
parameter list, ( ).



MPE/iX 5.0 Documentation