Re: Why the asprintf patch is still breaking the buildfarm

Поиск
Список
Период
Сортировка
От Noah Misch
Тема Re: Why the asprintf patch is still breaking the buildfarm
Дата
Msg-id 20131023010533.GA451025@tornado.leadboat.com
обсуждение исходный текст
Ответ на Re: Why the asprintf patch is still breaking the buildfarm  (Tom Lane <tgl@sss.pgh.pa.us>)
Ответы Re: Why the asprintf patch is still breaking the buildfarm  (Tom Lane <tgl@sss.pgh.pa.us>)
Re: Why the asprintf patch is still breaking the buildfarm  (Florian Weimer <fweimer@redhat.com>)
Список pgsql-hackers
On Tue, Oct 22, 2013 at 11:00:42AM -0400, Tom Lane 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.
> 
> The point here is that we still need to cope with pre-C99 implementations
> that might return -1 or the given buffer size on overflow.  The NetBSD
> implementation doesn't do that, which is reasonable in their context, but
> not workable for us.

I would vote for choosing the standard we want vsnprintf() to follow (probably
C99) and substituting a conforming implementation wherever "configure" detects
that libc does not conform.  We'll be shipping some replacement vsnprintf() in
any case; we may as well use it to insulate the rest of our code from
less-preferred variants.

-- 
Noah Misch
EnterpriseDB                                 http://www.enterprisedb.com



В списке pgsql-hackers по дате отправления:

Предыдущее
От: Andres Freund
Дата:
Сообщение: matviews do not lock relations during refresh
Следующее
От: Andres Freund
Дата:
Сообщение: missing locking in at least INSERT INTO view WITH CHECK