SPL to HP C/XL Migration Guide (30231-90001)

8-: 5
| | parameters. The formal parameters "expect" |
| | the converted forms and reconvert them |
| | accordingly. HP C/XL does not check |
| | parameters. |
| | |
---------------------------------------------------------------------------------------------
| | |
| Addresses are 16-bit pointers. | Addresses are 32-bit pointers. |
| | |
---------------------------------------------------------------------------------------------
The HP C/XL equivalent of a
formal
"reference" simple variable or point-
er parameter is a pointer to simple variable or pointer to pointer,
respectively. This amounts (mostly) to the addition of a leading "*"
dereference operator everywhere the formal parameter is used in the
function, in the form "*
formal-parm
".
The HP C/XL equivalent of an
actual
"reference" simple variable or
pointer parameter is the address of the simple variable or pointer,
respectively. The address is obtained with the "&" address operator, in
the form "&
actual-parm
".
Since array-ids (no subscript) are passed as pointers, they are
implicitly pass-by-reference. That is, they may be passed as actual
parameters and used as formal parameters without the "&" and "*"
operators. If an array
cell
is passed by reference to an array or
pointer formal parameter, it requires the "&" operator, as in
"&
array-id
[
cell
]".
Options
Table 8-5. Options
---------------------------------------------------------------------------------------------
| | |
| SPL | HP C/XL Equivalent |
| | |
---------------------------------------------------------------------------------------------
| | |
| CHECK
level
| No equivalent. |
| | |
| Specifies varying degrees of parameter | HP C/XL performs no parameter checking. |
| checking for an external procedure. | |
| | |
---------------------------------------------------------------------------------------------
| | |
| EXTERNAL (Table 8-2, format 3a) | extern storage class (Table 8-2, format 3) |
| | |
| Defines the name, type, and parameters of a | The
formal-parm
list is omitted because HP |
| procedure which exists external to the | C/XL performs no parameter checking on |
| current program. | functions. |
| | |
---------------------------------------------------------------------------------------------
| | |
| FORWARD (Table 8-2, format 3b) | extern storage class (Table 8-2, format 3) |
| | |
| Specifies that the procedure will be | The function may be declared elsewhere in |
| declared fully later in the program. | the same compilation unit or in a separate |
| Allows a procedure to be called prior to | unit. If a function is not declared before |
| its declaration. | it is called, its type defaults to |
| | "function returning int". |
| | |
---------------------------------------------------------------------------------------------
| | |
| INTERNAL | No direct equivalent. |
| | |