comp.lang.ada
 help / color / mirror / Atom feed
From: mfeldman@seas.gwu.edu (Michael Feldman)
Subject: Re: GNAT and subunits
Date: 27 Mar 1995 16:12:27 -0500
Date: 1995-03-27T16:12:27-05:00	[thread overview]
Message-ID: <3l79nr$nnt@felix.seas.gwu.edu> (raw)
In-Reply-To: 3l6j48$82t@ns1.sw-eng.falls-church.va.us

In article <3l6j48$82t@ns1.sw-eng.falls-church.va.us>,
Philip Brashear <brashear@ns1.sw-eng.falls-church.va.us> wrote:

>Here's my problem:  I have a program (Prog) with a subunit (procedure Sub).
>When I compile Prog, GNAT requires me to provide a file containing Sub.  OK,
>I can live with that -- I'll just provide a stub.  So, compiling shows me
>that my interfaces are pretty much correct.  I link and execute.

I'm not terribly happy with that; IMHO it is not in keeping with the
whole idea of subunits, which is that one can compile the parent of
subunits without having any completion at all. It's not much different,
in my view, from being able to compile a spec without the body of a
package.

>Now, I complete Sub (in the file Prog-Sub.adb).  If I just submit Prog-Sub.adb 
>to the compiler (as is my usual habit, and, I think, the common way of doing
>things), I get the usual "No code generated ... " message.  I now link and
>execute.  Guess what!  The STUB version of Sub is still used!  That is, 
>re-compiling the separate subprogram (alone) does not appear to affect the
>"library".

GNAT wants to compile a parent and its subunits in the same compilation.
Given that this is the case (and I said above that I don;t like it), then,
in my opinion, the situation you describe is a binder bug. 

GNAT cannot have it both ways. If a subunit has been changed (and GNAT uses 
the file-modification timestamp to detect this), then GNAT should not allow 
simple re-binding, but should require the parent to be compiled. To do 
otherwise is to violate consistency rules.

Did you just re-_link_, or go back through the GNAT binder? Given that
GNAT is more "open" than many other compilers, you can end-run 
the binding process very easily. If you went through the binder, and
were not asked to re-compile the parent package body, I think this is a
serious bug.

>Can someone convince me that this is OK?

No.
>
>Can someone convince me that this is a GOOD THING?

No.

BTW - the GNAT group always asks that if you post a note like this to CLA,
you always cc: gnat-report@cs.nyu.edu, because they always read that
mail but don;t always  get around to reading the newsgroup.

:-)

Mike Feldman



  reply	other threads:[~1995-03-27 21:12 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1995-03-27 14:46 GNAT and subunits Philip Brashear
1995-03-27 21:12 ` Michael Feldman [this message]
1995-03-28 12:58   ` Philip Brashear
1995-04-04  0:00     ` Robert Dewar
1995-03-27 22:20 ` Robert I. Eachus
1995-03-28  0:00 ` Robert Dewar
1995-03-30  0:00   ` Tucker Taft
1995-04-01  0:00     ` Michael Feldman
1995-03-28 16:57 ` Tucker Taft
replies disabled

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