From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 2941 invoked by alias); 2 Aug 2003 00:16:10 -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 2712 invoked from network); 2 Aug 2003 00:16:07 -0000 Received: from unknown (HELO localhost.redhat.com) (24.157.166.107) by sources.redhat.com with SMTP; 2 Aug 2003 00:16:07 -0000 Received: from redhat.com (localhost [127.0.0.1]) by localhost.redhat.com (Postfix) with ESMTP id 2935A2B7F for ; Fri, 1 Aug 2003 20:15:52 -0400 (EDT) Message-ID: <3F2B02B8.3020906@redhat.com> Date: Sat, 02 Aug 2003 00:16:00 -0000 From: Andrew Cagney User-Agent: Mozilla/5.0 (X11; U; NetBSD macppc; en-US; rv:1.0.2) Gecko/20030223 X-Accept-Language: en-us, en MIME-Version: 1.0 To: gdb@sources.redhat.com Subject: Allow C++ or C99 in sim/*? Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-SW-Source: 2003-08/txt/msg00024.txt.bz2 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