From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 28430 invoked by alias); 18 Feb 2011 11:48:03 -0000 Received: (qmail 28402 invoked by uid 22791); 18 Feb 2011 11:48:02 -0000 X-SWARE-Spam-Status: No, hits=-1.9 required=5.0 tests=AWL,BAYES_00,T_RP_MATCHES_RCVD X-Spam-Check-By: sourceware.org Received: from mail.codesourcery.com (HELO mail.codesourcery.com) (38.113.113.100) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Fri, 18 Feb 2011 11:47:58 +0000 Received: (qmail 18106 invoked from network); 18 Feb 2011 11:47:56 -0000 Received: from unknown (HELO scottsdale.localnet) (pedro@127.0.0.2) by mail.codesourcery.com with ESMTPA; 18 Feb 2011 11:47:56 -0000 From: Pedro Alves To: gdb-patches@sourceware.org Subject: Re: [RFA] Fix display of array of unspecified length inside structures Date: Fri, 18 Feb 2011 11:59:00 -0000 User-Agent: KMail/1.13.5 (Linux/2.6.35-25-generic; KDE/4.6.0; x86_64; ; ) Cc: "Pierre Muller" References: <00ac01cbcf5c$31f5bc00$95e13400$@muller@ics-cnrs.unistra.fr> In-Reply-To: <00ac01cbcf5c$31f5bc00$95e13400$@muller@ics-cnrs.unistra.fr> MIME-Version: 1.0 Content-Type: Text/Plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Message-Id: <201102181147.52337.pedro@codesourcery.com> X-IsSubscribed: yes Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org X-SW-Source: 2011-02/txt/msg00454.txt.bz2 On Friday 18 February 2011 11:08:38, Pierre Muller wrote: > PS: It could be wise to add some test in the testsuite for > this, but I have no idea where I could insert this kind of test, > any ideas? Yes, please. We have surprisingly few tests for this sort of thing, AFAICS. I'm not even sure this is a regression from my recent changes, I think it may well not be. Zero-length arrays (as poor man's flexible arrays) are supported in GNU C as an extension. To be portable, you'd need to use an array of length 1 (or c99's real flexible arrays), but that won't trigger the bug. I'd point at printcmds.exp, but I'm not sure if there are compilers out there that choke on the construct... There's always a new test file option... > PS2: It is probably impossible to make such a test without > alloca or some other memory allocation function, no? > Are there any system restriction for this? Should be fine. > 2011-02-18 Pierre Muller > > * c-valprint.c (c_val_print): Add embedded_offset to address > for arrays of unspecified length. > * p-valprint.c (pascal_val_print): Likewise. Okay, thanks. -- Pedro Alves