HP Pascal/iX Reference Manual (31502-90022)

12- 18
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.
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.