| I was about to make a comment about the person who wrote the code, but
then I checked 2098.6 and saw it was me... I guess the author was
too cleaver for his own good. :-) :-)
To quote from 2098.6,
> There is no way to "omit" a procedure parameter when calling one Pascal
> routine from another.
and
> Here's an example (with magic to emulate calling Pascal from a
> non-Pascal caller).
Well, one incompatable change when moving from VAX to Alpha is using
bound procedure values like the example tries to fake up. There
is a section in the User Manual, Chapter 9 "Migrating from OpenVMS VAX
to OpenVMS Alpha", section 9.5 "Bound Procedure Values".
As long as you don't trick the compiler, moving from VAX to Alpha was
transparent in this area. Programs such as this (or trying to use
Pascal and C with routine parameters) can unfortunately see the
difference. We never added any feature for "present but 0" like
was discussed back in 2098 since that was the only time somebody raised
the issue.
I can see two choices,
1) Use "%IMMED 0" on OpeVMS Alpha and use "%REF 0" on OpenVMS VAX.
That would mean you only have to visit the declarations and not
the call sites or the routine bodies. Since we don't have a
preprocessor on OpenVMS, you'll have to use some trick to get one set
of declarations for Alpha and other for VAX. Either 2 sets of modules
or perhaps do a %INCLUDE 'SOMELOGICALNAME' for the routine default
value and define the SOMELOGICALNAME to point to a file containing
"%IMMED 0" or one containing "%REF 0" before you do the compilation.
2) You can leave the %REF 0 alone, but go to the routine bodies and
change the test for present from the simple "iaddress(p1) = 0" to
type pint = ^integer_address;
var p1addr,p2addr : integer_address;
p1addr := iaddress(p1);
if p1addr::pint^ = 0 then { routine is absent }
This scheme doesn't require you change the definitions or the callers,
just the code in the called routine.
You can even add some code that checks the machine architecture and
"does the right thing" so the code would be compatible between OpenVMS
VAX and OpenVMS Alpha.
-John
|