Re: Why the asprintf patch is still breaking the buildfarm

From: David Rowley <dgrowleyml(at)gmail(dot)com>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: Manlio Perillo <manlio(dot)perillo(at)gmail(dot)com>, PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Why the asprintf patch is still breaking the buildfarm
Date: 2013-10-23 10:16:10
Message-ID: CAApHDvqNVSc=DYYuvt13YyHmrhCvYH4wb_o6Ha1Gz+sCAvUdKA@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Wed, Oct 23, 2013 at 4:00 AM, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> wrote:

> Yeah. As a separate matter, it might be useful to revise stringinfo.c
> and the asprintf code so that *if* the returned value is larger than the
> given buffer size, we use it as a guide to resizing, avoiding the possible
> need to loop multiple times to make the buffer large enough. And we could
> also improve our own implementation of snprintf to follow the C99 spec.
>
>
Attached is a draft patch which implements this.
I didn't bother making the translation macros make use of the extra data as
I
didn't think we would have many translations long enough to take advantage
of it.

I think it's a good idea to take advantage of the buffer size if
vsnprintf() has gone
to the trouble of working out what is needed for us. It seems quite
wasteful to throw this information away.

Comments are welcome.

Regards

David

Attachment Content-Type Size
appendStringInfoVA.patch application/octet-stream 5.3 KB

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Heikki Linnakangas 2013-10-23 11:33:19 Re: all_visible replay aborting due to uninitialized pages
Previous Message Samrat Revagade 2013-10-23 09:41:47 Re: Review of pg_rewind