Xref: utzoo gnu.g++.help:719 comp.lang.c++:13050 Path: utzoo!utgpu!watserv1!watmath!uunet!mcsun!tuvie!rcvie!fs_reise From: fs_reise@rcvie.at (Christian Reiser) Newsgroups: gnu.g++.help,comp.lang.c++ Subject: g++ vs c++ Summary: Differences between GNU and AT&T C++ summary Keywords: g++, c++, GNU, AT&T Message-ID: <1991Apr23.064149.13659@rcvie.at> Date: 23 Apr 91 06:41:49 GMT Sender: Reply-To: fs_reise@rcvie.at (Christian Reiser) Organization: Alcatel Austria - Elin Research Center, Vienna Lines: 77 For those, who have not read my previous posted question, I asked for the differences between GNU's g++ 1.37.1 and AT&T's C++ compiler both compiling C++ language definition 2.0. (I was not interested in legal problems, because I just want to estimate the technical aspects.) By now I got 5 answers (thanks to all of them) and 4 questions to post a summary (as I do now). Note, that I did not check the statements, but just repost them. * to port g++ to AT&T, just small things have to be changed. * g++ accepts more, but nothing of them is realy importandt (you just have to change it.) For instance: static variables can be initialized directly in class definitions. * g++ 1.37 has problems with multiple inheritance. * In g++ 1.37 some minor bugs exist (local enums, ambigous function declarations ...) * the differences in syntax are not dificult, but the differences in fstream are a real big problem. * The preprocessor of g++ is ANSI, but AT&T's is not. * On some machines, g++ executables are bigger. * GNU's way of message passing is more efective and brings advantages in execution speed. Here the part from GNU's manual: * The naming convention of GNU C++ and AT&T C++ for overloaded functions (and member functions) are incompatible. You cannot use AT&T C++ libraries with GNU C++. Even if the same naming convention were used, you still would not want to use libraries compiled by the AT&T compiler. Because the AT&T compiler is constrained to generate C code, there are some things it cannot implement, such as the way GNU C++ passes objects constructed on the stack. GNU C++ can also make most virtual function calls take one or two memory references, while the AT&T compiler must make 5 or 6 memory references to do the same thing. This efficiency has its cost: if you want to link with AT&T code, compile it with GNU C++. * GNU's error messages and especially debugging possibilies are much better. AT&T sometimes only writes "syntax error line XXX". * There is no source level debugging posibility at AT&T's. * AT&T generates per default warnings, which g++ does not give like - unreachable code (after return) - function arguments not used * For AT&T all include files have to be given, while g++ accepts some missing "#include <...>" lines. (Perhaps because some include files include others differently for both compilers.) This is what I got till now. If you have any comments to this, do not hesidate to e-mail me. If some interesting aspects occur, I will post a second summary. Again thanks to everybody who sent me his comments, I hope this summary is some help for all. Greetings from Vienna/Austria CR --------------------------------------------------------------------------- | Christian Reiser | Tel.: +431 39 16 21 / 247 | | Alcatel Austria - Elin RC | Fax.: +431 39 14 52 | | Ruthnergasse 1-7, A-1210 Wien | E-mail: fs_reise@rcvie.at | | Austria | or: ...(!mcsun)!tuvie!rcvie!fs_reise | --------------------------------------------------------------------------- -- Greetings from Vienna/Austria CR ---------------------------------------------------------------------------