comp.lang.ada
 help / color / mirror / Atom feed
From: st92j0gw@dunx1.ocs.drexel.edu (Chris Papademetrious)
Subject: Re: types in procedure arguments
Date: 1996/09/30
Date: 1996-09-30T00:00:00+00:00	[thread overview]
Message-ID: <52nj8q$4ck@noc2.drexel.edu> (raw)
In-Reply-To: dewar.843919606@schonberg


dewar@schonberg.cs.nyu.edu (Robert Dewar) wrote:
>"gcc -c best_test.adb
>best_test.adb:45:35: expected private type "LIST_ID" defined at
>double_list.ads: 43
>best_test.adb:45:35: found private type "LIST_ID" defined at
>double_list.ads:43
>"

>This is almost certainly a bug in GNAT, but you did not say what version
>you are using (most such bugs were squashed a while ago). If you are using
>the current version, or even a version from 3.04 on, then send along a bug
>report to report@gnat.com. if you are using an earlier version, then upgrade
>first.

 We're using gnat 3.05, and I really believe that GNAT is correct and
I'm misunderstanding something about Ada 95 here.

 I want to pass the type LIST_ID to a procedure I've defined.  The
problem is that I've defined the type LIST_ID twice:

 1. at the beginning of the level where I call this procedure
 2. in the package that holds the procedure itself, so I can use the
type LIST_ID as a procedure argument

 The problem here is that each of these originates a new and unique
"type LIST_ID" which aren't compatible with each other.  Thus, the
calling statement that passes a type (1) of LIST_ID does not match the
type (2) LIST_ID of the argument in the procedure being called!

 This seems basic, the idea of calling a subprogram with a type, and
needing to define the type in a package so the subprogram can be
declared.  How is this handled in Ada 95???  I'd be more than happy to
provide a small test program, if anyone could lend me a hand.  I've
been battling this for two weeks, and no books have been of any help.

 - Chris


-=-=-=-=-=-=-=-=-=-=-=-=-
 Chris Papademetrious
 Data Fusion Laboratory
 Drexel University
 Philadelphia, PA
-=-=-=-=-=-=-=-=-=-=-=-=-





  reply	other threads:[~1996-09-30  0:00 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1996-09-28  0:00 types in procedure arguments Robert Dewar
1996-09-30  0:00 ` Chris Papademetrious [this message]
1996-09-30  0:00   ` Norman H. Cohen
1996-09-30  0:00   ` Stephen Leake
  -- strict thread matches above, loose matches on Subject: below --
1996-09-23  0:00 Chris Papademetrious
1996-09-25  0:00 ` Stephen Leake
1996-09-28  0:00 ` Chris Papademetrious
1996-09-28  0:00 ` Chris Papademetrious
1996-09-30  0:00 ` Chris Papademetrious
1996-10-01  0:00   ` Stephen Leake
1996-10-01  0:00   ` Robert Dewar
1996-10-01  0:00   ` Norman H. Cohen
1996-10-01  0:00   ` Robert A Duff
replies disabled

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