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

From Nicolai Tufar
Subject Re: [pgsql-hackers-win32] [HACKERS] snprintf causes regression tests to fail
Date
Msg-id d80929390503012206557ba543@mail.gmail.com
Whole thread Raw
In response to Re: [pgsql-hackers-win32] [HACKERS] snprintf causes regression tests to fail  (Tom Lane <tgl@sss.pgh.pa.us>)
Responses Re: [pgsql-hackers-win32] [HACKERS] snprintf causes regression tests to fail
List 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

pgsql-patches by date:

Previous
From: Tom Lane
Date:
Subject: Re: [pgsql-hackers-win32] [HACKERS] snprintf causes regression tests to fail
Next
From: Tom Lane
Date:
Subject: Re: [pgsql-hackers-win32] [HACKERS] snprintf causes regression tests to fail