From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 31560 invoked by alias); 2 Aug 2003 01:30:55 -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 31547 invoked from network); 2 Aug 2003 01:30:50 -0000 Received: from unknown (HELO mms3.broadcom.com) (63.70.210.38) by sources.redhat.com with SMTP; 2 Aug 2003 01:30:50 -0000 Received: from 63.70.210.1 by mms3.broadcom.com with ESMTP (Broadcom SMTP Relay (MMS v5.5.2)); Fri, 01 Aug 2003 18:30:48 -0700 Received: from mail-sj1-5.sj.broadcom.com (mail-sj1-5.sj.broadcom.com [10.16.128.236]) by mon-irva-11.broadcom.com (8.9.1/8.9.1) with ESMTP id SAA14668; Fri, 1 Aug 2003 18:30:11 -0700 (PDT) Received: from ldt-sj3-010.sj.broadcom.com (ldt-sj3-010 [10.21.64.10]) by mail-sj1-5.sj.broadcom.com (8.12.9/8.12.9/SSF) with ESMTP id h721Uaov006078; Fri, 1 Aug 2003 18:30:36 -0700 (PDT) Received: (from cgd@localhost) by ldt-sj3-010.sj.broadcom.com ( 8.11.6/8.9.3) id h721UaW25599; Fri, 1 Aug 2003 18:30:36 -0700 X-Authentication-Warning: ldt-sj3-010.sj.broadcom.com: cgd set sender to cgd@broadcom.com using -f To: ac131313@redhat.com cc: gdb@sources.redhat.com Subject: Re: Allow C++ or C99 in sim/*? References: <3F2B02B8.3020906@redhat.com> From: cgd@broadcom.com Date: Sat, 02 Aug 2003 01:30:00 -0000 In-Reply-To: Message-ID: User-Agent: Gnus/5.09 (Gnus v5.9.0) Emacs/21.2 MIME-Version: 1.0 X-WSS-ID: 1335CBC2727382-01-01 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-SW-Source: 2003-08/txt/msg00032.txt.bz2 At Sat, 2 Aug 2003 00:16:31 +0000 (UTC), "Andrew Cagney" wrote: > 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? C99 isn't necessarily completely implemented, as has been pointed out. While i occasionally like to use // comments, and find them more visually appealing than /* */ comments, i don't think there's a strong win in using them. declarations "anywhere," IMO, just clutter things. Personally, i'd limit declarations to start of blocks and to perhaps one or two other places, e.g. declaring local vars for use in 'for' loops. ("for int i = ...") However, these things have been in c++ for a while, right? > - C++ which would also allow access to objects and (ulgh?) templates > (replacement for the sim-endian macro stuff?) If the sim tree goes there to any large extent, then it would force some simulator maintainers to learn C++. I don't see that happening any time soon, at least for one particular maintainer... 8-) I guess it wouldn't hurt (much) to: * make infrastructure compatible (to the extent easily possible), * tolerate use of some (relatively minor) new language features in existing simulator code, and * *possibly* encourage implementors of new sims to do so in different languages. I must also say that performance *is* a concern. Our goal in doing sim work was to be able to real code (i.e., "telnet into the operating system running on the simulator, communicating via the simulated ethernet device which talks out on the real network..."). If improving the system meant slowing it down much, then that would be a real lose. (honestly, i don't know enough about modern C++ to know if using it extensively is likely to mean decrease in performance... but it's not clear that there's great incentive for me to find out. 8-) chris