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,4c019ad9cc913bbe X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2002-09-18 15:50:46 PST Path: archiver1.google.com!news1.google.com!newsfeed.stanford.edu!canoe.uoregon.edu!hammer.uoregon.edu!skates!not-for-mail From: Stephen Leake Newsgroups: comp.lang.ada Subject: Re: The Dreaded "Missing Subunits" Date: 18 Sep 2002 18:41:49 -0400 Organization: NASA Goddard Space Flight Center (skates.gsfc.nasa.gov) Message-ID: References: <1b585154.0209121449.ef12609@posting.google.com> <3D819EE7.3A69E5EB@praxis-cs.co.uk> NNTP-Posting-Host: anarres.gsfc.nasa.gov Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: skates.gsfc.nasa.gov 1032389488 20120 128.183.220.71 (18 Sep 2002 22:51:28 GMT) X-Complaints-To: usenet@news.gsfc.nasa.gov NNTP-Posting-Date: 18 Sep 2002 22:51:28 GMT User-Agent: Gnus/5.09 (Gnus v5.9.0) Emacs/21.2 Xref: archiver1.google.com comp.lang.ada:29140 Date: 2002-09-18T22:51:28+00:00 List-Id: Robert A Duff writes: > Anyway, this all seems rather convoluted. Why can't the > compiler/builder automatically determine which compilation units are in > which files? Why is a separate tool needed? And a separate file of > pragmas Source_File_Name to maintain? In order for the compiler to determine which compilation units are in which files, it has to read all the files in the compilation environment, build the list of file -> unit name mappings, and then compile them. gnatname + gnatmake does this (caveat; I don't use gnatname). You said this would be "too slow"; which requirement do you really want? speed or naming convenience? It's faster if you cache the results of the name scan; gnatname does this. But as you say, the make system has to be able to determine when to rerun gnatname, or do it incrementally. One of the requirements of the GNAT design is the source-based "library"; there are no data structures required to run the compiler, other than the source files. Running gnatname automatically starts to violate this principle. ObjectAda takes a different approach; you have to manually tell it what files are in the compilation environment (at least, last time I used it; one reason I gave it up :). No possibility to automatically rescan for new files. > Furthermore, none of this mumbo-jumbo would be necessary at all, if > only all Ada compilers agreed on the file naming convention. Doesn't seem likely, especially now. > (I must admit, that wasn't easy in the days when operating systems > had unreasonable limits on file names (like only one dot, or only 8 > characters). Are those bad-old-days over?) I hope they are over. But we are stuck with their legacy; all of the GNAT compiler source files are krunched to 8.3 names. > I also admit that C has it easy in this regard, since it has no > proper notion of "module" separate from source file. That is part of the problem. -- -- Stephe