From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 9697 invoked by alias); 27 May 2006 11:12:38 -0000 Received: (qmail 9688 invoked by uid 22791); 27 May 2006 11:12:38 -0000 X-Spam-Check-By: sourceware.org Received: from mail.gmx.de (HELO mail.gmx.net) (213.165.64.20) by sourceware.org (qpsmtpd/0.31) with SMTP; Sat, 27 May 2006 11:12:35 +0000 Received: (qmail invoked by alias); 27 May 2006 11:12:32 -0000 Received: from p3E9E6A89.dip.t-dialin.net (EHLO licht.localdomain) [62.158.106.137] by mail.gmx.net (mp018) with SMTP; 27 May 2006 13:12:32 +0200 X-Authenticated: #25218368 Received: from licht.localdomain (localhost.localdomain [127.0.0.1]) by licht.localdomain (8.12.5/8.12.5) with ESMTP id k4RBCTbt022938 for ; Sat, 27 May 2006 13:12:29 +0200 Received: (from pes@localhost) by licht.localdomain (8.12.5/8.12.5/Submit) id k4RBCSts022936 for gdb@sourceware.org; Sat, 27 May 2006 13:12:28 +0200 From: Peter Schauer Message-Id: <200605271112.k4RBCSts022936@licht.localdomain> Subject: gdb/m2-typeprint.c does not compile with older gcc versions To: gdb@sourceware.org Date: Sat, 27 May 2006 14:22:00 -0000 X-Mailer: ELM [version 2.5 PL6] MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Y-GMX-Trusted: 0 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/msg00380.txt.bz2 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: --- m2-typeprint.c.orig 2006-05-23 18:06:34.773753000 +0200 +++ m2-typeprint.c 2006-05-23 19:55:21.047509000 +0200 @@ -504,13 +504,14 @@ m2_record_fields (struct type *type, str } else if (show > 0) { + int i; + int len = TYPE_NFIELDS (type); + if (TYPE_CODE (type) == TYPE_CODE_STRUCT) fprintf_filtered (stream, "RECORD\n"); else if (TYPE_CODE (type) == TYPE_CODE_UNION) /* i18n: Do not translate "CASE" and "OF" */ fprintf_filtered (stream, _("CASE OF\n")); - int i; - int len = TYPE_NFIELDS (type); for (i = TYPE_N_BASECLASSES (type); i < len; i++) { -- Peter Schauer Peter.Schauer@mytum.de