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: [PATCH v2 01/31] Introduce string_printf


> +std::string
> +string_printf (const char* fmt, ...)

std::string is unfortunately kind of large for a return value
its 4 * sizeof (void *), but maybe the simplicity matters more here.

> +{
> +  std::string str;
> +  va_list vp;
> +
> +  /* Start by assuming some reasonable size will be sufficient.  */
> +  str.resize (1024);
> +
> +  while (1)
> +    {
> +      size_t size;
> +      int result;

you could declare these at first use right?

Trev


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