From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00 autolearn=ham autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,cc4a1f5e11494cc9 X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 1995-03-28 05:19:46 PST Path: nntp.gmd.de!Germany.EU.net!howland.reston.ans.net!news.sprintlink.net!uunet!gwu.edu!gwu.edu!not-for-mail From: mfeldman@seas.gwu.edu (Michael Feldman) Newsgroups: comp.lang.ada Subject: Re: GNAT and subunits Date: 27 Mar 1995 16:12:27 -0500 Organization: George Washington University Message-ID: <3l79nr$nnt@felix.seas.gwu.edu> References: <3l6j48$82t@ns1.sw-eng.falls-church.va.us> NNTP-Posting-Host: 128.164.9.3 Date: 1995-03-27T16:12:27-05:00 List-Id: In article <3l6j48$82t@ns1.sw-eng.falls-church.va.us>, Philip Brashear 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