From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 9297 invoked by alias); 28 May 2006 22:22:07 -0000 Received: (qmail 9288 invoked by uid 22791); 28 May 2006 22:22:07 -0000 X-Spam-Check-By: sourceware.org Received: from intranet.codesourcery.com (HELO mail.codesourcery.com) (65.74.133.6) by sourceware.org (qpsmtpd/0.31) with ESMTP; Sun, 28 May 2006 22:22:05 +0000 Received: (qmail 16633 invoked from network); 28 May 2006 22:22:04 -0000 Received: from unknown (HELO localhost) (jimb@127.0.0.2) by mail.codesourcery.com with ESMTPA; 28 May 2006 22:22:04 -0000 To: Joel Brobecker Cc: Peter Schauer , gdb@sourceware.org, gdb-patches@sources.redhat.com Subject: Re: gdb/m2-typeprint.c does not compile with older gcc versions References: <200605271112.k4RBCSts022936@licht.localdomain> <20060527175215.GH1062@adacore.com> From: Jim Blandy Date: Mon, 29 May 2006 14:47:00 -0000 In-Reply-To: <20060527175215.GH1062@adacore.com> (Joel Brobecker's message of "Sat, 27 May 2006 10:52:15 -0700") Message-ID: User-Agent: Gnus/5.11 (Gnus v5.11) Emacs/22.0.50 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-IsSubscribed: yes Mailing-List: contact gdb-help@sourceware.org; run by ezmlm Precedence: bulk List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-owner@sourceware.org X-SW-Source: 2006-05/txt/msg00384.txt.bz2 Joel Brobecker writes: > On Sat, May 27, 2006 at 01:12:28PM +0200, Peter Schauer wrote: >> gdb/m2-typeprint.c does not compile with older gcc versions, e.g. gcc-2.95.2. >> It is caused by declarations after code, which is a gcc extension AFAIK. >> The gdb-6.5 branch is affected as well. >> Here is a fix: > > Thanks Peter. To me, this is an obvious fix, so I checked it in for you > in both head and 6.5 branch. > > 2006-05-27 Joel Brobecker > > From Peter Schauer > * m2-typeprint.c (m2_record_fields): Move variable declarations > to the begining of the block. > > Tested by re-building GDB after patch. For what it's worth, ISO C99 allows declarations after code. I don't know when it was introduced. GDB is supposed to only require C90, according to doc/gdbint.texinfo, so I agree the patch is right, though.