From: Daniel Jacobowitz <drow@mvista.com>
To: gdb@sources.redhat.com
Subject: Re: Allow C++ or C99 in sim/*?
Date: Sat, 02 Aug 2003 00:43:00 -0000 [thread overview]
Message-ID: <20030802004348.GB12924@nevyn.them.org> (raw)
In-Reply-To: <3F2B02B8.3020906@redhat.com>
On Fri, Aug 01, 2003 at 08:15:52PM -0400, Andrew Cagney wrote:
> 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
I don't think C99 is a done deal:
- GCC C99 support is still not finished, though it's mostly there now
of course.
- GCC 2.95 is still in wide use, and doesn't allow declarations after
statements.
- C99 _libraries_, which are the interesting bit, are very rare. I
bet that most of our commercial host platforms aren't all there
yet.
I also don't see what C99 adds that would be particularly useful to
sim, besides maybe the int32_t etc. types.
> debug C++ code would be a good thing (TM), and there are a few chunks of
Amen.
> the simulator code that really shouldn't be C. Java would be, well,
Also amen. If it weren't so unlikely to fly, I'd suggest allowing C++
in GDB :) It really would make some things easier. But requiring a C++
compiler for sim/ at least gives a step in that direction.
--
Daniel Jacobowitz
MontaVista Software Debian GNU/Linux Developer
next prev parent reply other threads:[~2003-08-02 0:43 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2003-08-02 0:16 Andrew Cagney
2003-08-02 0:43 ` Daniel Jacobowitz [this message]
2003-08-02 0:47 ` David Carlton
[not found] ` <mailpost.1059783391.21631@news-sj1-1>
2003-08-02 1:30 ` cgd
2003-08-05 4:25 ` Andrew Cagney
2003-08-05 4:27 ` Daniel Jacobowitz
2003-08-02 1:11 Michael Elizabeth Chastain
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20030802004348.GB12924@nevyn.them.org \
--to=drow@mvista.com \
--cc=gdb@sources.redhat.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox