Path: utzoo!utgpu!water!watmath!clyde!att!osu-cis!tut.cis.ohio-state.edu!mailrus!nrl-cmf!ames!ai.etl.army.mil!mike From: mike@ai.etl.army.mil (Mike McDonnell) Newsgroups: comp.lang.c++ Subject: Re: Standards For C++ Message-ID: <188@ai.etl.army.mil> Date: 3 Oct 88 12:08:36 GMT References: <255@itivax.UUCP> <6590067@hplsla.HP.COM> <1988Sep29.164824.25390@utzoo.uucp> Reply-To: mike@ai.etl.army.mil (Mike McDonnell) Organization: USAETL, Fort Belvoir, Virginia Lines: 36 In article <1988Sep29.164824.25390@utzoo.uucp> henry@utzoo.uucp (Henry Spencer) writes: >In practice, in the absence of formal standards processes (e.g. ANSI), >de-facto standards tend to be set by whatever documents are available. >At present, we essentially have two levels of standard for the language >itself: Bjarne's book, and his paper in the C++ Workshop proceedings >(which includes multiple inheritance and a number of other things). The >formal reference manual he now has in the works will probably supersede >the latter in the public eye. Implementations can define standards as well as documentation can. GNU's "g++" has some good ideas that differ from Stroustrup's book. In particular, they have modified the language slightly to allow a LALR(1) grammar rather than the infinite-lookahead required by "the book". This allows better optimization and more "modern" compiler techology, or so they say. There are lesser differences as well; as documented with the distribution. These ideas should be considered. Here is the relevant part of the g++ documentation, complete with a characteristic Stallman diatribe: * The design of the C++ programming language did not take into account the usefulness of being able to specify that language using an LALR(1) grammar. As a result, in order to correctly parse it, one needs a look-ahead lexical analyzer (with infinite lookahead), and a recursive descent parser, guided by some good heuristics. This approach was not taken in GNU C++, because it is considered archaic, notoriously difficult to extend syntactically, and generally offensive. GNU C++ uses an LALR(1) grammar so that users can easily understand, and readily modify the compiler to suit their needs. Free software is useless if it becomes captive to an inaccessible or undesirable technology. However, in providing such a grammar, some syntactic forms were lost, most notably old-style C function declarations and occasionally function parameters which are declared longhand to be pointers to functions are not recognized properly. -- Mike McDonnell at the U.S. Army Engineer Topographic Laboratories, Bldg. 2592 Fort Belvoir, VA 22060-5546 TEL:(202)355-2724 ARPA: mike@ai.etl.army.mil