[gnu.g++.help] g++ vs c++

fs_reise@rcvie.at (Christian Reiser) (04/16/91)

Hi all,
	we usually develop our c++ programs on gnu g++ 1.37.1 and 
I am content with it. 

	But there are others who think to change to AT&T C++ compiler,
both compiling C++ language definition 2.0. 

	Now I heard some roumors, that gnu's syntax checking is less
strict than AT&T's. How much troubles besides the use of different
libraries will it bring. Any experiences?

	Which compiler would you propose (but do not bother me
with legal problems, I just have to estimate the technical adpect).

Please e-mail.
Thanks in advance

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                        E-mail: fs_reise@rcvie.at
A-1210 Wien                              or: ...(!mcsun)!tuvie!rcvie!fs_reise
Austria
-- 
Greetings from Vienna/Austria
CR

Christian Reiser			Tel.: +431 39 16 21 / 247

fs_reise@rcvie.at (Christian Reiser) (04/23/91)

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

 ---------------------------------------------------------------------------