From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 23817 invoked by alias); 19 Jun 2002 09:00:50 -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 23707 invoked from network); 19 Jun 2002 09:00:41 -0000 Received: from unknown (HELO Cantor.suse.de) (213.95.15.193) by sources.redhat.com with SMTP; 19 Jun 2002 09:00:41 -0000 Received: from Hermes.suse.de (Charybdis.suse.de [213.95.15.201]) by Cantor.suse.de (Postfix) with ESMTP id D94FB147A3; Wed, 19 Jun 2002 11:00:40 +0200 (MEST) X-Authentication-Warning: sykes.suse.de: schwab set sender to schwab@suse.de using -f To: Andrew Cagney Cc: gdb-patches@sources.redhat.com Subject: Re: RFA: ``set mips abi'' References: <20020613185151.GA352@nevyn.them.org> <3D0FA494.3040706@cygnus.com> <20020618213416.GA2881@nevyn.them.org> <3D0FB375.7060704@cygnus.com> <20020618223408.GA5128@nevyn.them.org> X-Yow: I wonder if I could ever get started in the credit world? From: Andreas Schwab Date: Wed, 19 Jun 2002 02:00:00 -0000 In-Reply-To: <20020618223408.GA5128@nevyn.them.org> (Daniel Jacobowitz's message of "Tue, 18 Jun 2002 18:34:08 -0400") Message-ID: User-Agent: Gnus/5.090006 (Oort Gnus v0.06) Emacs/21.3.50 (ia64-suse-linux) MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit X-SW-Source: 2002-06/txt/msg00361.txt.bz2 Daniel Jacobowitz writes: |> > >You can do it very easily with designated initializers, but they are |> > >not adequately portable. You can do it very easily building the array |> > >at runtime but why bother? Keeping two lists in sync is not the most |> > >complicated thing in the world. |> > |> > (what's a designated initializer?) |> |> I think I'm mixing terms here; I'm thinking of two language extensions |> in GCC and c99. The pertinent one is: The term is correct, but the C99 syntax is different. |> void *array[] = { |> [1] NULL, |> [2] some_void_ptr, |> [3] NULL, |> }; void *array[] = { [1] = NULL, [2] = some_void_ptr, [3] = NULL, }; |> I think you can use enum values as the tags but I'm not quite sure. You can use any constant expression in an array designator. Andreas. -- Andreas Schwab, SuSE Labs, schwab@suse.de SuSE Linux AG, Deutschherrnstr. 15-19, D-90429 Nürnberg Key fingerprint = 58CA 54C7 6D53 942B 1756 01D3 44D5 214B 8276 4ED5 "And now for something completely different."