From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 9536 invoked by alias); 1 Feb 2003 06:13:15 -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 9529 invoked from network); 1 Feb 2003 06:13:13 -0000 Received: from unknown (HELO takamaka.act-europe.fr) (80.13.79.230) by 172.16.49.205 with SMTP; 1 Feb 2003 06:13:13 -0000 Received: by takamaka.act-europe.fr (Postfix, from userid 507) id 06266D34AE; Sat, 1 Feb 2003 10:13:11 +0400 (RET) Date: Sat, 01 Feb 2003 06:13:00 -0000 From: Joel Brobecker To: Andrew Cagney Cc: gdb-patches@sources.redhat.com Subject: Re: [patch/rfc] Eliminate char buf[MAX_REGISTER_RAW_SIZE] Message-ID: <20030201061310.GB22468@gnat.com> References: <3E3AFFA5.9080902@redhat.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <3E3AFFA5.9080902@redhat.com> User-Agent: Mutt/1.4i X-SW-Source: 2003-02/txt/msg00011.txt.bz2 > Since MAX_REGISTER_RAW_SIZE is implemented using a function the declaration: > > char buf[MAX_REGISTER_RAW_SIZE]; > > is illegal. (GCC does allow it which is why no one notices :-/). > > The attached patch updates all obvious (as in found by a grep) > occurances of this and changes them to: > > char *buf = alloca (max_register_raw_size (current_gdbarch)); I have a simple (stupid?) question: Generaly speaking, is there a prefered form between the following two? max_register_raw_size (current_gdbarch) or MAX_REGISTER_RAW_SIZE These two forms are exactly equivalent, but in most occurences I've seen in the code, we used the macro... But maybe you used the non-macro form to show that we do an alloca because the size of the buffer is not known at compile-time? -- Joel