Re: [pgsql-hackers-win32] snprintf causes regression tests

Поиск
Список
Период
Сортировка
От Bruce Momjian
Тема Re: [pgsql-hackers-win32] snprintf causes regression tests
Дата
Msg-id 200503141855.j2EItGp11936@candle.pha.pa.us
обсуждение исходный текст
Ответ на Re: [pgsql-hackers-win32] snprintf causes regression tests to fail  (Nicolai Tufar <ntufar@gmail.com>)
Ответы Re: [pgsql-hackers-win32] snprintf causes regression tests to fail
Список pgsql-hackers
Nicolai Tufar wrote:
> On Thu, 10 Mar 2005 19:21:41 -0500 (EST), Bruce Momjian
> <pgman@candle.pha.pa.us> wrote:
> > > The CVS-tip implementation is fundamentally broken and won't work even
> > > for our internal uses.  I've not wasted time complaining about it
> > > because I thought we were going to replace it.  If we can't find a
> > > usable replacement then we're going to have to put a lot of effort
> > > into fixing what's there.  On the whole I think the effort would be
> > > better spent importing someone else's solution.
> >
> > Oh, so our existing implementation doesn't even meet our needs. OK.

(Your new patch is in the queue.)

I have been thinking about our current snprintf() implementation.  As I
remember, we use snprintf mostly for an snprintf that doesn't support
long long, and now those that don't support %$.  I am wondering if we
should just process long long args and %$ args, and pass everything else
to the native snprintf.

In fact, one trick would be to substitute long long and %$ in the printf
format string, and then pass that to the native libc printf, with
adjustments for the printf format arguments.  That might be simpler than
emulating all of snprintf.

FYI, now that we are using pg_snprintf macros the native snprintf is
available to us.

Anyway, I am sure there are some platforms that don't have vsnprint or
snprintf, but could we just say we don't support them, or emulate one of
we only have the other?

--
  Bruce Momjian                        |  http://candle.pha.pa.us
  pgman@candle.pha.pa.us               |  (610) 359-1001
  +  If your life is a hard drive,     |  13 Roberts Road
  +  Christ can be your backup.        |  Newtown Square, Pennsylvania 19073

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

Предыдущее
От: Greg Stark
Дата:
Сообщение: Re: invalidating cached plans
Следующее
От: Tom Lane
Дата:
Сообщение: Re: [pgsql-hackers-win32] snprintf causes regression tests to fail