Re: draft patch for strtof()

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Andrew Gierth <andrew(at)tao11(dot)riddles(dot)org(dot)uk>
Cc: pgsql-hackers(at)postgresql(dot)org
Subject: Re: draft patch for strtof()
Date: 2019-01-16 15:20:59
Message-ID: 28380.1547652059@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Andrew Gierth <andrew(at)tao11(dot)riddles(dot)org(dot)uk> writes:
> As discussed in the Ryu thread, herewith a draft of a patch to use
> strtof() for float4 input (rather than using strtod() with its
> double-rounding issue).

The errno handling in strtof seems bizarrely overcomplex; why do
you need the separate caller_errno variable?

> This includes a fallback to use strtod() the old way if the platform
> lacks strtof(). A variant file for the new regression tests is needed
> for such platforms; I've taken a stab at setting this up for the one
> platform we know will need it (if there are others, the buildfarm will
> let us know in due course).

I'm not that much on board with introducing test cases that we know,
beyond question, are going to be portability headaches. What will
we actually gain with this, compared to just not having the test case?
I can't see that it's worth either the buildfarm cycles or the human
maintenance effort just to prove that, yes, some platforms have
portability corner cases. I also don't like the prospect that we
ship releases that will fail basic regression tests on platforms
we haven't tested. Coping with such failures is a large burden
for affected packagers or end users, especially when the only useful
"coping" mechanism is to ignore the regression test failure. Might
as well not have it.

regards, tom lane

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Andrew Gierth 2019-01-16 15:46:23 Re: draft patch for strtof()
Previous Message Shay Rojansky 2019-01-16 15:11:36 Re: [PATCH] Allow UNLISTEN during recovery