From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 11612 invoked by alias); 2 Aug 2003 00:43:49 -0000 Mailing-List: contact gdb-help@sources.redhat.com; run by ezmlm Precedence: bulk List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-owner@sources.redhat.com Received: (qmail 11605 invoked from network); 2 Aug 2003 00:43:48 -0000 Received: from unknown (HELO nevyn.them.org) (66.93.172.17) by sources.redhat.com with SMTP; 2 Aug 2003 00:43:48 -0000 Received: from drow by nevyn.them.org with local (Exim 4.20 #1 (Debian)) id 19ikUu-0003Os-EN for ; Fri, 01 Aug 2003 20:43:48 -0400 Date: Sat, 02 Aug 2003 00:43:00 -0000 From: Daniel Jacobowitz To: gdb@sources.redhat.com Subject: Re: Allow C++ or C99 in sim/*? Message-ID: <20030802004348.GB12924@nevyn.them.org> Mail-Followup-To: gdb@sources.redhat.com References: <3F2B02B8.3020906@redhat.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <3F2B02B8.3020906@redhat.com> User-Agent: Mutt/1.5.1i X-SW-Source: 2003-08/txt/msg00027.txt.bz2 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