From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 29101 invoked by alias); 1 Mar 2013 18:40:21 -0000 Received: (qmail 28958 invoked by uid 22791); 1 Mar 2013 18:40:19 -0000 X-SWARE-Spam-Status: No, hits=-4.5 required=5.0 tests=AWL,BAYES_00,KHOP_THREADED,RCVD_IN_DNSWL_NONE,RCVD_IN_HOSTKARMA_YE,SPF_SOFTFAIL X-Spam-Check-By: sourceware.org Received: from mtaout22.012.net.il (HELO mtaout22.012.net.il) (80.179.55.172) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Fri, 01 Mar 2013 18:40:15 +0000 Received: from conversion-daemon.a-mtaout22.012.net.il by a-mtaout22.012.net.il (HyperSendmail v2007.08) id <0MIZ00000VT1M200@a-mtaout22.012.net.il> for gdb-patches@sourceware.org; Fri, 01 Mar 2013 20:40:13 +0200 (IST) Received: from HOME-C4E4A596F7 ([87.69.4.28]) by a-mtaout22.012.net.il (HyperSendmail v2007.08) with ESMTPA id <0MIZ000HAVUXFE60@a-mtaout22.012.net.il>; Fri, 01 Mar 2013 20:40:10 +0200 (IST) Date: Fri, 01 Mar 2013 18:40:00 -0000 From: Eli Zaretskii Subject: Re: [RFA] Constify find_condition_and_thread In-reply-to: <5130F0FD.2040203@redhat.com> To: Keith Seitz Cc: gdb-patches@sourceware.org Reply-to: Eli Zaretskii Message-id: <83ppzjufp5.fsf@gnu.org> References: <5130F0FD.2040203@redhat.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: 2013-03/txt/msg00036.txt.bz2 > Date: Fri, 01 Mar 2013 10:18:37 -0800 > From: Keith Seitz > > - expr = parse_exp_1 (&tok, pc, block_for_pc (pc), 0); > + orig = copy = xstrdup (tok); > + cleanup = make_cleanup (xfree, orig); > + expr = parse_exp_1 (©, pc, block_for_pc (pc), 0); > xfree (expr); > + tok += copy - orig; > + do_cleanups (cleanup); If we really need this kind of dance, just to avoid explicit casts to 'char *', there should be a comment explaining why we do this. Thanks.