comp.lang.ada
 help / color / mirror / Atom feed
From: GDAU100@BGUVM.BITNET ("Jonathan B. Owen")
Subject: converted types as actual in out parameters
Date: 17 Sep 88 11:18:27 GMT	[thread overview]
Message-ID: <8809151803.AA17461@ajpo.sei.cmu.edu> (raw)

The following worked for Vax-Ada but not for Verdix Ada.  Any thoughts?
Is it a quirk of Vax-Ada to allow the following or a bug of Verdix
which causes the return of erronious values?

   procedure TEST is

       a : short_integer;

       procedure set_value( value : in out integer ) is
       begin
          value := 1;
       end set_value;

   begin
       set_value( integer(a) );

       if a = 1
       then
           put_line("This is a Vax-Ada compiler!");
       else
           put_line("Is this a Verdix Ada compiler?");
       end if;
   end TEST;

The Version of the Verdix Ada I tried was very old (ver. 2?).   Maybe in newer
version this is corrected.  I noticed in this version that the "pack" pragma
does not work!  Each field of the packed record starts on a new boundry.

Also,  **** BUG IN VAX-ADA COMPILER ***, try converting a value of type
real to short_integer.  You will get during compilation "Compiler Internal
Error"!.  I solved the problem by an intermediate conversion to integer
and only then to short_integer.

                  I would appreciate any comments on the above.

                                                            JB
______________________________________________________________________________
  (--)    /--)     /-(\                 Email: gdau100@bguvm (bitnet)
  \ /    /--K      | \|/\   /\/) /|-\   Snail: 55 Hovevei Zion
  _/_/o /L__)_/o \/\__/  \X/  \_/ | |_/        Tel-Aviv, 63346  ISRAEL
 (/        Jonathan B. Owen             Voice: (03) 281-422

 Point of view:  A chicken is the means by which an egg reproduces an egg.
______________________________________________________________________________

             reply	other threads:[~1988-09-17 11:18 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1988-09-17 11:18 "Jonathan B. Owen" [this message]
1988-09-20 16:05 ` converted types as actual in out parameters Scott Moody
1988-09-23 15:41 ` Burch Seymour
  -- strict thread matches above, loose matches on Subject: below --
1988-09-16 23:48 sboyd
replies disabled

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox