Peter Eisentraut <peter@eisentraut.org> writes:
> I have been hunting down the last few pieces of code that made some
> obsolete claims about not being able to use C99 yet or needing to be
> compatible with pre-C99 or something like that. I found two obsolete
> comments and two places where we could now actually use the C99
> functionality that the comment was anticipating.
Two comments:
* In 0001,
- * This implementation conforms to IEEE Std 1003.1 and GLIBC, in that the
- * case of hypot(inf,nan) results in INF, and not NAN.
I have a distinct recollection that this comment exists because we
found that some platforms had a hypot() that got that edge case wrong.
I don't object to proceeding on the assumption that they all conform
to spec by now, but please make sure there's at least one regression
test that will expose the problem if someplace doesn't. (A quick check
would be to hot-wire pg_hypot to do the wrong thing and see if any
existing test falls over. I think there is one, but let's verify.)
* In 0003, we can't be very sure what "isblank((unsigned char) c)"
will do with non-ASCII input data, except that it could very
easily do insane things with fragments of a multibyte character.
I recommend keeping pg_isblank but redefining it along the lines of
bool
pg_isblank(unsigned char c)
{
return (!IS_HIGHBIT_SET(c) && isblank(c));
}
to ensure the previous treatment of non-ASCII data.
(It could be made static in hba.c, perhaps)
regards, tom lane