From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 17889 invoked by alias); 9 Mar 2013 01:04:12 -0000 Received: (qmail 17881 invoked by uid 22791); 9 Mar 2013 01:04:11 -0000 X-SWARE-Spam-Status: No, hits=-7.2 required=5.0 tests=AWL,BAYES_00,KHOP_RCVD_UNTRUST,KHOP_SPAMHAUS_DROP,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; Sat, 09 Mar 2013 01:04:02 +0000 Received: from int-mx01.intmail.prod.int.phx2.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id r29142Sq013786 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Fri, 8 Mar 2013 20:04:02 -0500 Received: from valrhona.uglyboxes.com (ovpn01.gateway.prod.ext.phx2.redhat.com [10.5.9.1]) by int-mx01.intmail.prod.int.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id r29140Zj000789 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Fri, 8 Mar 2013 20:04:01 -0500 Message-ID: <513A8A80.4040905@redhat.com> Date: Sat, 09 Mar 2013 01:04:00 -0000 From: Keith Seitz User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:13.0) Gecko/20120605 Thunderbird/13.0 MIME-Version: 1.0 To: Pedro Alves CC: GDB Patches Subject: Re: [RFA] "constify" parse_exp_1 References: <51392C56.7040302@redhat.com> <51392F3F.5090102@redhat.com> <51393886.9030602@redhat.com> <5139D92B.5090106@redhat.com> <5139EDDB.8080201@redhat.com> <513A899C.2030800@redhat.com> In-Reply-To: <513A899C.2030800@redhat.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit 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: 2013-03/txt/msg00392.txt.bz2 On 03/08/2013 05:00 PM, Pedro Alves wrote: >> This is perfectly fine: >> >> for (loc = t->base.loc; loc; loc = loc->next) >> { >> - p = tmp_p; >> + const char *q; >> + >> + q = tmp_p; >> - exp = parse_exp_1 (&p, loc->address, >> + exp = parse_exp_1 (&q, loc->address, >> block_for_pc (loc->address), 1); >> + p = (char *) q; >> >> It's perfectly valid, as we know Q on output must point within >> the object/string TMP_P pointed at on entry. >> This reads much more intuitively to me, no funny arithmetic, and >> gets rid of the aliasing issue with the other suggestion, and >> no new function necessary. > > And confirmed this approach is valid. I have a revision, but after this morning's fiasco, I'm a bit leery of submitting it until substantial further review. My focus is waxing quickly right now. I've also got amendments to address Tom's comments. Thanks, Keith