From patchwork Thu Nov 2 22:36:01 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tom Tromey X-Patchwork-Id: 24048 Received: (qmail 7039 invoked by alias); 2 Nov 2017 22:36:18 -0000 Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org Delivered-To: mailing list gdb-patches@sourceware.org Received: (qmail 7014 invoked by uid 89); 2 Nov 2017 22:36:18 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-24.9 required=5.0 tests=AWL, BAYES_00, GIT_PATCH_0, GIT_PATCH_1, GIT_PATCH_2, GIT_PATCH_3, RCVD_IN_DNSWL_NONE, SPF_HELO_PASS autolearn=ham version=3.3.2 spammy=rfa X-HELO: gateway33.websitewelcome.com Received: from gateway33.websitewelcome.com (HELO gateway33.websitewelcome.com) (192.185.145.4) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Thu, 02 Nov 2017 22:36:16 +0000 Received: from cm13.websitewelcome.com (cm13.websitewelcome.com [100.42.49.6]) by gateway33.websitewelcome.com (Postfix) with ESMTP id 68E0F2E44FA for ; Thu, 2 Nov 2017 17:36:15 -0500 (CDT) Received: from box5379.bluehost.com ([162.241.216.53]) by cmsmtp with SMTP id AO5veb860rWstAO5veKU76; Thu, 02 Nov 2017 17:36:15 -0500 Received: from 71-218-90-63.hlrn.qwest.net ([71.218.90.63]:58978 helo=bapiya.Home) by box5379.bluehost.com with esmtpsa (TLSv1.2:ECDHE-RSA-AES256-GCM-SHA384:256) (Exim 4.89) (envelope-from ) id 1eAO5v-003CfJ-6R; Thu, 02 Nov 2017 17:36:15 -0500 From: Tom Tromey To: gdb-patches@sourceware.org Cc: Tom Tromey Subject: [RFA 02/13] Remove cleanups from link_callbacks_einfo Date: Thu, 2 Nov 2017 16:36:01 -0600 Message-Id: <20171102223612.3642-3-tom@tromey.com> In-Reply-To: <20171102223612.3642-1-tom@tromey.com> References: <20171102223612.3642-1-tom@tromey.com> X-BWhitelist: no X-Source-L: No X-Exim-ID: 1eAO5v-003CfJ-6R X-Source-Sender: 71-218-90-63.hlrn.qwest.net (bapiya.Home) [71.218.90.63]:58978 X-Source-Auth: tom+tromey.com X-Email-Count: 3 X-Source-Cap: ZWx5bnJvYmk7ZWx5bnJvYmk7Ym94NTM3OS5ibHVlaG9zdC5jb20= X-Local-Domain: yes This removes a cleanup from link_callbacks_einfo by using std::string. gdb/ChangeLog 2017-11-02 Tom Tromey * compile/compile-object-load.c (link_callbacks_einfo): Use std::string. --- gdb/ChangeLog | 5 +++++ gdb/compile/compile-object-load.c | 9 ++------- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/gdb/compile/compile-object-load.c b/gdb/compile/compile-object-load.c index 41d5fc347f..8e55d3c2c9 100644 --- a/gdb/compile/compile-object-load.c +++ b/gdb/compile/compile-object-load.c @@ -281,18 +281,13 @@ static void link_callbacks_einfo (const char *fmt, ...) static void link_callbacks_einfo (const char *fmt, ...) { - struct cleanup *cleanups; va_list ap; - char *str; va_start (ap, fmt); - str = xstrvprintf (fmt, ap); + std::string str = string_vprintf (fmt, ap); va_end (ap); - cleanups = make_cleanup (xfree, str); - - warning (_("Compile module: warning: %s"), str); - do_cleanups (cleanups); + warning (_("Compile module: warning: %s"), str.c_str ()); } /* Helper for bfd_get_relocated_section_contents.