This is the mail archive of the gdb@sources.redhat.com mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Allow C++ or C99 in sim/*?


Not like I work in sim/ anyways ... so all this is from the
peanut gallery.

I like C++ more than C99.

If we go with C99, and actually start using C99 features, we'll get
unhappy users who still have C90 compilers.  And if we tell them "just
use gcc" (which I think is a valid response) then we might as well
go all the way to C++.

My experience with C++ is that it makes some maintenance tasks easier.
If there is a crappy class, it's easier to rip out / rewrite a class in
C++ than it is to do the equivalent in C.

We would get massive dogfood benefits from writing in C++.  That would
be the major benefit.

For a C++ coding standard, there are several views.  The official Bjarne
Stroustrup view is to use the whole freakin' language because every
feature in the language is there for a good reason.  For the purpose
of eating dogfood, that is a reasonable thing.

My personal view is that I stay away from templates and rtti because
they require link time support, thus are less portable.  Also I stay
away from namespaces because they confuse gdb.  That would be a reason
*for* using namespaces for us!  And I eschew exceptions because I don't
like the way they were glommed onto the language as an afterthought.

gcc 2.95.3 has a usable C++ compiler, although it's incomplete in many
areas.

Michael C


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]