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,112ee4ae931079e6 X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2003-09-14 21:16:11 PST Path: archiver1.google.com!news1.google.com!newsfeed.stanford.edu!logbridge.uoregon.edu!newshub.sdsu.edu!elnk-nf2-pas!newsfeed.earthlink.net!wn14feed!wn13feed!wn11feed!worldnet.att.net!bgtnsc04-news.ops.worldnet.att.net.POSTED!not-for-mail From: Dave Thompson Newsgroups: comp.lang.ada Subject: Re: Using GNU make with ObjectAda Message-ID: References: X-Newsreader: Forte Agent 1.93/32.576 English (American) MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Date: Mon, 15 Sep 2003 04:16:10 GMT NNTP-Posting-Host: 12.89.146.34 X-Complaints-To: abuse@worldnet.att.net X-Trace: bgtnsc04-news.ops.worldnet.att.net 1063599370 12.89.146.34 (Mon, 15 Sep 2003 04:16:10 GMT) NNTP-Posting-Date: Mon, 15 Sep 2003 04:16:10 GMT Organization: AT&T Worldnet Xref: archiver1.google.com comp.lang.ada:42508 Date: 2003-09-15T04:16:10+00:00 List-Id: On 06 Sep 2003 16:37:31 +0200, Ludovic Brenta wrote: > "Tim Spargo" writes: > Not true. Make files were invented only to overcome the shortcomings > of the C language with respect to separate compilation, and C++ > happily kept these shortcomings. > The make tool and its files were invented originally in the Unix environment primarily for C, but FORTRAN of the day had the same issues which make also could be and was used to solve. So did most if not all assemblers, and PL/I, which were all of the languages you were likely to separately compile and link together other than COBOL, which partly evaded the issue by having only character-structured data, and maybe Pascal, which mostly had its own private tools. C++ didn't directly set out to fix any of these issues, but in order to provide overloaded functions the original implementation and AFAIK all since use(d) name mangling which provides *partial* checks on consistency for functions, but not for class contents (members), and particularly the classes functions/methods operate on. > In Ada, separate compilation, as well as the rules for consistency, > are defined by the language (the ARM devotes the entire Chapter 10, > "Program Structure and Compilation Issues", to this). > > In C and C++, separate compilation is defined not by the language but > by the particular tools ("make" and linker) you use. For example, the > ISO C99 standard defines the "extern" keyword (6.2), external > definitions (6.9), and the #include preprocessor directive (6.10.2) All keywords as such are in 6.4.1, and the syntax(es) using the extern keyword are in 6.7.1 and 6.9.1; but it is actually external *linkage* that matters, defined by 6.2.2 and 6.7.1 (and a little bit by 6.7.4), and linkage is only loosely, er, linked to the keyword: you can have external linkage without using the keyword, and in some particularly silly cases you can use the keyword without getting external linkage. Note that 6.9 "external definitions" really means library-level (Ada) or file-scope (C), not necessarily external in the sense of crossing compilation units. > but does not define how object files must be linked together, much > less any rules for consistency. It does give rules requiring the *program* to be consistent about (external) functions and variables, primarily 6.5.2.2 and 6.5 respectively. (Remember in C function includes procedure.) What it does not require is any implementation (compiler, linker, etc.) support for checking them, and in fact such support is very rarely provided, although it is *legal* to do so. (An implementation *is* required to check consistency *within* a compilation unit and scope -- as you would minimally expect -- for variables and for functions using the "modern" 1980s prototype syntax but not for the legacy "K&R1" 1970 syntax.) > "make" provides you with a separate > language and interpreter (very different from C) that allows you to > describe the relationships between your source and object files. Not > only is "make" not part of C/C++, you can even use alternatives such > as "ant" or "cook". > Agree there. > As P.J. Plaugher once said, "above 100,000 lines of code, we should > all be coding in Ada". Plauger. The h belongs in Kernighan. Or perhaps Knuth. :-) - David.Thompson1 at worldnet.att.net