From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 2099 invoked by alias); 6 Aug 2002 01:26:49 -0000 Mailing-List: contact gdb-patches-help@sources.redhat.com; run by ezmlm Precedence: bulk List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sources.redhat.com Received: (qmail 2092 invoked from network); 6 Aug 2002 01:26:48 -0000 Received: from unknown (HELO crack.them.org) (65.125.64.184) by sources.redhat.com with SMTP; 6 Aug 2002 01:26:48 -0000 Received: from dsl254-114-118.nyc1.dsl.speakeasy.net ([216.254.114.118] helo=nevyn.them.org ident=mail) by crack.them.org with asmtp (Exim 3.12 #1 (Debian)) id 17bt7a-0002dy-00; Mon, 05 Aug 2002 20:26:50 -0500 Received: from drow by nevyn.them.org with local (Exim 3.35 #1 (Debian)) id 17bt7m-0003wE-00; Mon, 05 Aug 2002 21:27:02 -0400 Date: Mon, 05 Aug 2002 18:26:00 -0000 From: Daniel Jacobowitz To: Joel Brobecker Cc: gdb-patches@sources.redhat.com Subject: Re: Question regarding bizarre ',' Message-ID: <20020806012702.GA15122@nevyn.them.org> Mail-Followup-To: Joel Brobecker , gdb-patches@sources.redhat.com References: <20020806012134.GC916@gnat.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20020806012134.GC916@gnat.com> User-Agent: Mutt/1.5.1i X-SW-Source: 2002-08/txt/msg00106.txt.bz2 On Mon, Aug 05, 2002 at 06:21:35PM -0700, Joel Brobecker wrote: > This is where I show my lack of C-knowledge: > > in i386v4-nat.c, I read the following code: > > /* Mapping between the general-purpose registers in `/proc' > format and GDB's register array layout. */ > static int regmap[] = > { > EAX, ECX, EDX, EBX, > UESP, EBP, ESI, EDI, > EIP, EFL, CS, SS, > DS, ES, FS, GS, > }; > > I would have thought that the last ',' would cause a compilation error. > But this seems to compile fine. Any reason for keeping this last comma? It makes it easier to add an element without having to touch any existing line, to make diffs clearer. A trailing comma in an array initializer (or struct initializer maybe?) is ignored. -- Daniel Jacobowitz Carnegie Mellon University MontaVista Software Debian GNU/Linux Developer