HP Pascal/iX Programmer's Guide (31502-90023)

10-: 7
A function type must be specified when using the intrinsic directive with
functions. A formal function type is compatible with an intrinsic
function type as long as the size of the formal type matches the size of
the intrinsic type.
NOTE In general, the formal type and the intrinsic type should match the
function return type. If the types do not match, they are the same
as a free union type coercion. This can cause problems for signed
versus unsigned types.
Example
program m(output);
var a,b:shortint;
buf:packed array[1..16] of char;
i:integer;
function calendar:shortint; intrinsic;
function cal_16 $alias 'calendar'$:bit16; intrinsic;
function neg:shortint;
begin
neg:=-1;
end;
begin
a := calendar;
b := calendar;
writeln(a = calendar,' ',a = b);
end.
Assuming the date did not change, the output is unexpected:
FALSE TRUE
Function cal_16 shows the correct definition; a and b should be declared
as bit16.
User-Defined Formal Parameters
If you want stricter type checking for an intrinsic's actual parameters,
you can declare formal parameters for some or all of its intrinsic
parameters. Then, actual parameter types are compared to their
corresponding formal parameter types, not to their corresponding
intrinsic parameter types. This type checking is as strict as that for
the parameter of a nonintrinsic routine: if the actual parameter is a
reference parameter, it must be of the same type as the formal
parameter; if the actual parameter is a value parameter, it must be
assignment-compatible with the formal parameter.
If an intrinsic is defined without an extensible parameter list, you
cannot declare it with one.
If an intrinsic is defined with an extensible parameter list, you can
declare it with or without one. If you declare the intrinsic with an
extensible parameter list, you must declare at least as many
nonextensible (required) parameters as the definition does. If you
declare the intrinsic without an extensible parameter list, you must
declare all of its nonextensible (required) parameters.
Example 1
The intrinsic file defines the intrinsic Pascal procedure intr this way:
PROCEDURE intr (a, b, c, d, e : integer)
OPTION EXTENSIBLE 2;