[HACKERS] random_fract and aix compiler bug

Поиск
Список
Период
Сортировка
От Zeugswetter Andreas SB SD
Тема [HACKERS] random_fract and aix compiler bug
Дата
Msg-id 46C15C39FEB2C44BA555E356FBCD6FA40184CED7@m0114.s-mxs.net
обсуждение исходный текст
Ответы Re: [HACKERS] random_fract and aix compiler bug  (Tom Lane <tgl@sss.pgh.pa.us>)
Список pgsql-patches
Hi Peter,

While fighting with a compiler bug here, I came across the following code,
that loops here (on AIX 4.3.2) due to a compiler bug,
presumably with the z < MAX_RANDOM_VALUE (it even warns at compile time):

static double
random_fract(void)
{
        long            z;

        /* random() can produce endpoint values, try again if so */
        do
        {
                z = random();
        } while (!(z > 0 && z < MAX_RANDOM_VALUE));
        return (double) z / (double) MAX_RANDOM_VALUE;
}

Since you where the last to commit on analyze.c I send you this mail,
since my mails currently don't pass some filter on postgresql.org

I have attached a patch as a workaround for this silly compiler bug.
Please consider to apply, Thanks

Andreas

Вложения

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

Предыдущее
От: Gaetano Mendola
Дата:
Сообщение: Re: minor HISTORY improvement
Следующее
От: Tom Lane
Дата:
Сообщение: Re: [HACKERS] random_fract and aix compiler bug