HP3000-L Archives

October 2000, Week 1

HP3000-L@RAVEN.UTC.EDU

Options: Use Monospaced Font
Show Text Part by Default
Show All Mail Headers

Message: [<< First] [< Prev] [Next >] [Last >>]
Topic: [<< First] [< Prev] [Next >] [Last >>]
Author: [<< First] [< Prev] [Next >] [Last >>]

Print Reply
Subject:
From:
Bill Cadier <[log in to unmask]>
Reply To:
Bill Cadier <[log in to unmask]>
Date:
Mon, 2 Oct 2000 18:14:00 -0600
Content-Type:
text/plain
Parts/Attachments:
text/plain (77 lines)
Hi Russell,

Here's one scenario that might explain the problem you see.

If the procedure you refer to was declared something like this:

    PROCEDURE whatever ( VAR something : varient_type )

a standard pass-by-reference parameter. Then the compiler is being
asked to generate a pointer to the parameter being passed to the
procedure (external or otherwise).  In this case the following would not
work:

   $check_actual_parm 2$
   whatever ( some_other_thing );

The compiler is essentially being asked to generate a different type of
pointer to pass to the procedure. That is not the intent of the compiler directive.
It's purpose is only to control how closely formal and actual parameters match.

If the procedure is altered and declared like this:

   varient_ptr_type = ^varient_type;
   ...
   PROCEDURE whatever ( something : varient_ptr_type );

Now it explicitly states that it accepts a pointer to a varient_type as its
parameter and this will work:

  $check_actual_parm 2$
  whatever ( addr(some_other_thing) );

The compiler is only being asked to overlook the fact that the type of the
pointer being passed does not match that declared for the procedure.

One thing I found in playing with this is that despite what the PASCAL
manual says about this being an HP PASCAL feature I get a warning
stating...

THIS FEATURE REQUIRES $STANDARD_LEVEL 'HP_MODCAL' (539)

Using HP_MODCAL gets rid of the warning. I'm not sure if the program would
run correctly with that un-fixed - didn't try that. But this seems like a 'bug' in
the PASCAL reference manual to me.

I hope this helps.

Best Regards,

Bill Cadier
HP/CSY

reply to: [log in to unmask]



>I have a procedure that is preceded with:
>
>$check_actual_parm 2$
>$check_formal_parm 2$
>
>also $standard_level 'HP_PASCAL'$.
>
>Yet I continue to to get:
>                                                  ^
>**** ERROR #  1   ACTUAL PARAMETER NOT COMPATIBLE WITH FORMAL PARAMETER
>(208)
>
>
>The formal parameter is a variant record with a bunch of different records
>as the variant types.  The actual parameter is one of those types.
>
>Anybody know anything else that would affect type checking for this source?
>
>-Russell
>

ATOM RSS1 RSS2