This is the mail archive of the
gdb@sources.redhat.com
mailing list for the GDB project.
Allow C++ or C99 in sim/*?
- From: Andrew Cagney <ac131313 at redhat dot com>
- To: gdb at sources dot redhat dot com
- Date: Fri, 01 Aug 2003 20:15:52 -0400
- Subject: Allow C++ or C99 in sim/*?
Hello,
Back in '95ish, I adopted ISO C 90 as its programming language for PSIM.
My decision was based on two assumptions: a C++ compiler would be more
buggy than C; the C language would be easier for a compiler to optimize
than C++; no one in their right mind still used K&R C. Over time, the
ISO C 90 assumption was gradually extended to other simulators (via
sim/igen and sim/common) and that led to the sim/ directory requiring
ISO C. This was all well before gdb/ adopted ISO C 90. History has
shown this to be a good decision.
Now, many years later, I think its time to revisit this:
Should the simulator directories allow more modern languages? I can see
several options:
- C99 which would allow C++ comments:
// a comment
and declarations anywhere:
foo (); int i; bar ()
and access to int32 et.al. types. What else?
- C++ which would also allow access to objects and (ulgh?) templates
(replacement for the sim-endian macro stuff?)
- Oh what the heck, Java and gcj ...
C99 should be a done deal. While I hate C++, making GDB developers
debug C++ code would be a good thing (TM), and there are a few chunks of
the simulator code that really shouldn't be C. Java would be, well,
interesting.
Thoughts? Coding standards?
Andrew