From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 26333 invoked by alias); 27 Sep 2012 10:13:43 -0000 Received: (qmail 26324 invoked by uid 22791); 27 Sep 2012 10:13:42 -0000 X-SWARE-Spam-Status: No, hits=-8.1 required=5.0 tests=AWL,BAYES_00,KHOP_RCVD_UNTRUST,KHOP_THREADED,RCVD_IN_DNSWL_HI,RCVD_IN_HOSTKARMA_W,RP_MATCHES_RCVD,SPF_HELO_PASS 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 Sep 2012 10:13:34 +0000 Received: from int-mx10.intmail.prod.int.phx2.redhat.com (int-mx10.intmail.prod.int.phx2.redhat.com [10.5.11.23]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id q8RADW3Y006582 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Thu, 27 Sep 2012 06:13:32 -0400 Received: from spoyarek (spoyarek.pnq.redhat.com [10.65.192.188]) by int-mx10.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id q8RADUF7015246; Thu, 27 Sep 2012 06:13:31 -0400 Date: Thu, 27 Sep 2012 10:13:00 -0000 From: Siddhesh Poyarekar To: Joel Brobecker Cc: gdb-patches@sourceware.org Subject: Re: [commit][obv] Use TYPE_LENGTH directly where possible Message-ID: <20120927154248.4561f9c4@spoyarek> In-Reply-To: <20120927095917.GA9624@adacore.com> References: <20120926132621.5f45acb7@spoyarek> <20120927095917.GA9624@adacore.com> Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit 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: 2012-09/txt/msg00618.txt.bz2 On Thu, 27 Sep 2012 11:59:17 +0200, Joel wrote: > > Index: gdb/amd64-tdep.c > [...] > > gdb_assert (class[1] != AMD64_MEMORY); > > - gdb_assert (len <= 16); > > + gdb_assert (TYPE_LENGTH (type) <= 16); > > Add a comment here to warn us against replacing the expression > with asserting on len, with an explanation as to why. This needs > to be done at every location where this trick is used. > > Do you think it's better to do things this way rather than declare > len with the correct type? I'd rather just revert the whole patch. This is the only patch where I have used this trick. I'll post it for review in a while... ... or I can revert the commit as obvious if it's OK ;) Regards, Siddhesh