HP 3000 Manuals

CHECK_FORMAL_PARM [ HP Pascal/iX Reference Manual ] MPE/iX 5.0 Documentation


HP Pascal/iX Reference Manual

CHECK_FORMAL_PARM 

CHECK_FORMAL_PARM is an HP Pascal Option.

The CHECK_FORMAL_PARM compiler option determines how closely the formal
parameters of a routine must match its actual parameters.  If the formal
and actual parameters are incompatible, the linker does not link the
program.

Syntax 

     $CHECK_FORMAL_PARM integer$

Parameter 

integer       In the range 0..3.  Determines how the linker checks actual
              parameters against formal parameters, as follows:

              Value   The linker checks: 

                0     Nothing.
                1     Function result type.
                2     Function result type,
                      number of routine parameters.
                3     Function result type,
                      number of routine parameters,
                      type of each parameter.

Default       3

Location      Anywhere.

CHECK_FORMAL_PARM affects every routine call that follows it (until
superceded by another CHECK_FORMAL_PARM). It lowers the type checking for
every call to these routines.  (Compare CHECK_ACTUAL_PARM, which is
intended to lower the type checking for a particular routine call.)  If
both CHECK_FORMAL_PARM and CHECK_ACTUAL_PARM apply to a routine, the
linker uses the lower type-checking value.

The type-checking for an external routine is compatible with that of the
language in which it is written.  (An external routine is identified as
such with the EXTERNAL directive.)

When you call an HP Pascal routine from a non-Pascal program, you must
compile the HP Pascal routine with $CHECK_FORMAL_PARM 0$ to turn
parameter checking off.  Otherwise, HP Pascal generates type-checking
information that the non-Pascal program cannot match.

The compiler does not generate type-checking code for intrinsic routines.
(An intrinsic routine is identified as such with the INTRINSIC directive.
See the HP Pascal/iX Programmer's Guide or the HP Pascal/HP-UX 
Programmer's Guide.)

Example 

     PAGE   1 HEWLETT-PACKARD  ...  (C) HEWLETT-PACKARD CO. 1986 ...

         0    1.000   0
         0    2.000   0
         0    3.000   0   $SUBPROGRAM$
         0    4.000   0   PROGRAM t;
         0    5.000   0
         0    6.000   0   $CHECK_FORMAL_PARM 0$
         0    7.000   0
         0    8.000   0   {CHECK_FORMAL_PARM prevents the linker from
         0    9.000   0    complaining if this procedure is called with
         0   10.000   0    fewer than seven actual parameters}
         0   11.000   0
         0   12.000   0   PROCEDURE proc (parm_count : integer;
         2   13.000   0                   parm1,
         3   14.000   0                   parm2,
         4   15.000   0                   parm3,
         5   16.000   0                   parm4,
         6   17.000   0                   parm5,
         7   18.000   0                   parm6      : integer);
         8   19.000   1   BEGIN
         8   20.000   1   END;
         8   21.000   0
         0   22.000   1   BEGIN
         0   23.000   1   END.



MPE/iX 5.0 Documentation