Re: 8.0.0beta1: make check fails on solaris8

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: 8.0.0beta1: make check fails on solaris8
Дата
Msg-id 4909.1092233563@sss.pgh.pa.us
обсуждение исходный текст
Ответ на 8.0.0beta1: make check fails on solaris8  (Martin Münstermann <mmuenstermann@betrusted.com>)
Ответы Re: 8.0.0beta1: make check fails on solaris8  (Martin Münstermann <mmuenstermann@betrusted.com>)
Список pgsql-bugs
>> My best guess about it is that strtod() is actively broken on your
>> platform, and is recognizing the "infinity" input but returning an
>> incorrect endptr.  I seem to recall that we've heard of such bugs
>> before.  Can you check for any updates from Sun that might affect
>> strtod()?

Hmm, take a look at this:
http://tcl.apache.org/sources/tcl/compat/fixstrtod.c.html

So at least the Tcl guys are aware of an issue.  It looks from this code
like they expect Solaris strtod to return an endptr one past the end of
the string.  Which would explain the apparently random behavior, because
that would be uninitialized memory --- if it happened to contain a zero
then we'd not register a complaint, but otherwise we would.

So forget my previous proposed patch and try this one:

    /* skip leading whitespace */
    while (*num != '\0' && isspace((unsigned char) *num))
        num++;

    errno = 0;
    val = strtod(num, &endptr);

+    if (endptr != num && endptr[-1] == 0)
+        endptr--;

    /* did we not see anything that looks like a double? */


            regards, tom lane

В списке pgsql-bugs по дате отправления:

Предыдущее
От: Fabien COELHO
Дата:
Сообщение: broken contrib/dbsize in cvs head?
Следующее
От: Andreas Pflug
Дата:
Сообщение: Re: broken contrib/dbsize in cvs head?