From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 17858 invoked by alias); 27 May 2010 20:08:10 -0000 Received: (qmail 17847 invoked by uid 22791); 27 May 2010 20:08:09 -0000 X-SWARE-Spam-Status: No, hits=-5.8 required=5.0 tests=AWL,BAYES_00,RCVD_IN_DNSWL_HI,SPF_HELO_PASS,T_RP_MATCHES_RCVD X-Spam-Check-By: sourceware.org Received: from mx1.redhat.com (HELO mx1.redhat.com) (209.132.183.28) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Thu, 27 May 2010 20:08:04 +0000 Received: from int-mx02.intmail.prod.int.phx2.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) by mx1.redhat.com (8.13.8/8.13.8) with ESMTP id o4RK7vO0015653 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Thu, 27 May 2010 16:07:57 -0400 Received: from ns3.rdu.redhat.com (ns3.rdu.redhat.com [10.11.255.199]) by int-mx02.intmail.prod.int.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id o4RK7u6m014093; Thu, 27 May 2010 16:07:56 -0400 Received: from opsy.redhat.com (ovpn01.gateway.prod.ext.phx2.redhat.com [10.5.9.1]) by ns3.rdu.redhat.com (8.13.8/8.13.8) with ESMTP id o4RK7t3l025634; Thu, 27 May 2010 16:07:56 -0400 Received: by opsy.redhat.com (Postfix, from userid 500) id BCC323780A5; Thu, 27 May 2010 14:07:54 -0600 (MDT) From: Tom Tromey To: "Pierre Muller" Cc: Subject: Re: [RFA-v2] dwarf2read.c: Avoid complaint for char array of unspecified size References: <38685.0063725889$1274473713@news.gmane.org> <002201caf93d$e6ea8190$b4bf84b0$@muller@ics-cnrs.unistra.fr> <34200.8848595016$1274864816@news.gmane.org> Reply-To: tromey@redhat.com Date: Thu, 27 May 2010 20:09:00 -0000 In-Reply-To: <34200.8848595016$1274864816@news.gmane.org> (Pierre Muller's message of "Wed, 26 May 2010 11:06:42 +0200") Message-ID: User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.1 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii 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: 2010-05/txt/msg00657.txt.bz2 >>>>> "Pierre" == Pierre Muller writes: Pierre> 2010-05-26 Pierre Muller Pierre> * dwarf2read.c (read_subrange_type): Create default subrange Pierre> type if DIE->NUM_ATTRS is zero. I think this is an improvement, but it would be preferable to just directly implement what DWARF specifies: If the subrange entry has no type attribute describing the basis type, the basis type is assumed to be the same as the object described by the lower bound attribute (if it references an object). If there is no lower bound attribute, or that attribute does not reference an object, the basis type is the type of the upper bound or count attribute (if either of them references an object). If there is no upper bound or count attribute, or neither references an object, the type is assumed to be the same type, in the source language of the compilation unit containing the subrange entry, as a signed integer with the same size as an address on the target machine. Pierre> + if (die->num_attrs == 0) A DW_TAG_subrange_type might have attributes that we ignore. So, I think there is no need for a check that is this specific; just determine the type according to the above algorithm, and remove the existing complaint code. Tom