This is the mail archive of the gdb-patches@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

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


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]