This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: [RFA 03/12] Remove cleanups from utils.c
- From: Pedro Alves <palves at redhat dot com>
- To: Tom Tromey <tom at tromey dot com>, gdb-patches at sourceware dot org
- Date: Thu, 28 Sep 2017 23:00:08 +0100
- Subject: Re: [RFA 03/12] Remove cleanups from utils.c
- Authentication-results: sourceware.org; auth=none
- Authentication-results: ext-mx07.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=redhat.com
- Authentication-results: ext-mx07.extmail.prod.ext.phx2.redhat.com; spf=fail smtp.mailfrom=palves at redhat dot com
- Dmarc-filter: OpenDMARC Filter v1.3.2 mx1.redhat.com AE517C04AC41
- References: <20170928195011.27382-1-tom@tromey.com> <20170928195011.27382-4-tom@tromey.com>
This is OK, with nits below.
On 09/28/2017 08:50 PM, Tom Tromey wrote:
> -
> - linebuffer = xstrvprintf (format, args);
> - old_cleanups = make_cleanup (xfree, linebuffer);
> - fputs_maybe_filtered (linebuffer, stream, filter);
> - do_cleanups (old_cleanups);
> + std::string linebuffer (string_vprintf (format, args));
Please use copy initialization:
std::string linebuffer = string_vprintf (format, args);
... to spare readers from wondering what explicit/converting
constructor this is trying to call.
> - linebuffer = xstrvprintf (format, args);
> - old_cleanups = make_cleanup (xfree, linebuffer);
> + std::string linebuffer (string_vprintf (format, args));
Ditto.
Thanks,
Pedro Alves