This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
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