Re: [RFA 03/12] Remove cleanups from utils.c

Pedro Alves
2017-09-28T22:00:26Z

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