HP 3000 Manuals

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


HP Pascal/iX Reference Manual

CHECK_ACTUAL_PARM 

CHECK_ACTUAL_PARM is an HP Pascal Option.

The CHECK_ACTUAL_PARM compiler option determines how closely the actual
parameters of routines must match their formal parameters in separately
compiled sources.  If the actual and formal parameters are incompatible,
the linker does not link the program.

Syntax 

     $CHECK_ACTUAL_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_ACTUAL_PARM affects every routine call that follows it (until
superceded by another CHECK_ACTUAL_PARM). However, its practical use is
to lower the type checking for a particular routine call.  (Compare
CHECK_FORMAL_PARM, which is intended to lower the type checking for
every call to a specific routine.)  If both CHECK_ACTUAL_PARM and
CHECK_FORMAL_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.)

Example 

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

         0    1.000   0
         0    2.000   0
         0    3.000   0   PROGRAM t;
         0    4.000   0
         0    5.000   0   TYPE
         0    6.000   0      int_ptr_type = ^integer;
         1    7.000   0      char_ptr_type = ^char;
         2    8.000   0
         2    9.000   0   VAR
         2   10.000   0      int_ptr  : int_ptr_type;
         3   11.000   0      char_ptr : char_ptr_type;
         4   12.000   0
         0   13.000   0   PROCEDURE proc (ip : int_ptr_type);
         0   14.000   0   EXTERNAL;
         0   15.000   0
         0   16.000   0   PROCEDURE $ALIAS 'proc'$ proc_c (cp : char_ptr_type);
         2   17.000   0   EXTERNAL;
         0   18.000   0
         0   19.000   0
         0   20.000   0   {Renaming the procedure gets around HP Pascal's}
         0   21.000   0   {parameter type checking}
         0   22.000   0
         4   23.000   1   BEGIN
         4   24.000   1
         4   24.000   1      proc(int_ptr);
         5   25.000   1
         5   26.000   1      $CHECK_ACTUAL_PARM 2$
         5   27.000   1      proc_c(char_ptr);
         6   28.000   1
         6   29.000   1      {Using CHECK_ACTUAL_PARM gets around the linker's}
         6   30.000   1      {parameter type checking}
         6   31.000   1
         6   32.000   1   END.



MPE/iX 5.0 Documentation