Re: BUG #1741: %i missing in snprintf implementation

Поиск
Список
Период
Сортировка
От Bruce Momjian
Тема Re: BUG #1741: %i missing in snprintf implementation
Дата
Msg-id 200507011434.j61EYFa11724@candle.pha.pa.us
обсуждение исходный текст
Ответ на Re: BUG #1741: %i missing in snprintf implementation  (Tom Lane <tgl@sss.pgh.pa.us>)
Список pgsql-bugs
Tom Lane wrote:
> "Tim Mauch" <tgmauch@yahoo.com> writes:
> > The implementation of snprintf/vsnprintf in src/port/snprintf.c does not
> > allow the use of %i ( %d equivalent ).  This likely isn't a problem for
> > postgres itself, but when a program compiles with -lpq and the standard c
> > libraries are not previously included the use of %i in the format string of
> > snprintf causes segmentation faults.
> > This is easily fixed by adding "case 'i':" to the same block of code handled
> > by "case 'd':" and case 'D':" in the implementation.
>
> We are certainly not going to buy into the assumption that our snprintf
> has to support every odd feature that anyone anywhere thinks snprintf
> should have :-(.  The correct response to this is to figure out how your
> program's calls got linked to our snprintf, and stop that from
> happening.
>
> AFAICS, our library should be defining the global symbol pg_snprintf not
> snprintf.  Can you look into why that's not happening for you?

Uh, the pg_snprintf macro fix is not in 8.0.X, only 8.1.  The good news,
however, is that very few platforms used our snprintf in 8.0 (the ones
that don't have 64-bit integer support in snprintf).

--
  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-bugs по дате отправления:

Предыдущее
От: "K.G.Sivaraman"
Дата:
Сообщение: BUG #1745: Unable to delete data from the database
Следующее
От: "Lance Clifner"
Дата:
Сообщение: BUG #1746: libpq/libpq-fs.h not included in distribution