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

From: Nicolai Tufar <ntufar(at)gmail(dot)com>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us>, Magnus Hagander <mha(at)sollentuna(dot)net>, PostgreSQL-patches <pgsql-patches(at)postgresql(dot)org>
Subject: Re: [pgsql-hackers-win32] [HACKERS] snprintf causes regression tests to fail
Date: 2005-03-02 06:06:35
Message-ID: d80929390503012206557ba543@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers pgsql-hackers-win32 pgsql-patches

Tom lane wrote:
> With CVS-tip snprintf I get
> result = '3 42'
> result = '3 3505'

I get similar results:
result = '3 42'
result = '9e-313 1413754129'

Now I agree with you, it is fundamentally broken.
We need to replace this implementation.

Bruce Momjian wrote:
> I can confirm that using "%I64d" for the printf format allows the
> regression tests to pass for int8.

But snprintf.c code does not support "%I64d" construct. It must
be picking OS's vsnprintf()

Bruce Momjian wrote:
> I think FreeBSD does.

I started with FreeBSD's vsnprintf() at first
but was set back by it's complexity and decided to
modify the port/snprintf.c code. Now would you like me
to incorporate FreeBSD's one into the code.
Give me a week and I will come with the patch.

Best regards,
Nicolai Tufar

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 2005-03-02 06:33:05 Re: [pgsql-hackers-win32] [HACKERS] snprintf causes regression tests to fail
Previous Message Tom Lane 2005-03-02 05:38:59 Re: [pgsql-hackers-win32] [HACKERS] snprintf causes regression tests to fail

Browse pgsql-hackers-win32 by date

  From Date Subject
Next Message Tom Lane 2005-03-02 06:33:05 Re: [pgsql-hackers-win32] [HACKERS] snprintf causes regression tests to fail
Previous Message Tom Lane 2005-03-02 05:38:59 Re: [pgsql-hackers-win32] [HACKERS] snprintf causes regression tests to fail

Browse pgsql-patches by date

  From Date Subject
Next Message Tom Lane 2005-03-02 06:33:05 Re: [pgsql-hackers-win32] [HACKERS] snprintf causes regression tests to fail
Previous Message Tom Lane 2005-03-02 05:38:59 Re: [pgsql-hackers-win32] [HACKERS] snprintf causes regression tests to fail