[HACKERS] random_fract and aix compiler bug - Mailing list pgsql-patches

From Zeugswetter Andreas SB SD
Subject [HACKERS] random_fract and aix compiler bug
Date
Msg-id 46C15C39FEB2C44BA555E356FBCD6FA40184CED7@m0114.s-mxs.net
Whole thread Raw
Responses Re: [HACKERS] random_fract and aix compiler bug  (Tom Lane <tgl@sss.pgh.pa.us>)
List 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

Attachment

pgsql-patches by date:

Previous
From: Gaetano Mendola
Date:
Subject: Re: minor HISTORY improvement
Next
From: Tom Lane
Date:
Subject: Re: [HACKERS] random_fract and aix compiler bug