Re: BUG #2162: Same as bug #1679 - finite() - unresolved symbol - Mailing list pgsql-bugs

From Tom Lane
Subject Re: BUG #2162: Same as bug #1679 - finite() - unresolved symbol
Date
Msg-id 28408.1137015183@sss.pgh.pa.us
Whole thread Raw
In response to BUG #2162: Same as bug #1679 - finite() - unresolved symbol  ("Francois Laupretre" <flconseil@yahoo.fr>)
Responses Re: BUG #2162: Same as bug #1679 - finite() - unresolved symbol
List pgsql-bugs
"F. Laupretre" <flconseil@yahoo.fr> writes:
> Or maybe, if it is really too smart (able to compute the result at
> compile time), we could have not to use a constant argument. Something
> like 'return finite((double)argv) ? 0 : 1'.

If the compiler is able to compute the result without using the external
function, that's fine.  That's equivalent to having a macro-based
implementation, which is exactly what we're going out of our way to
allow here.  All that we have to do is ensure that the compiler can't
discard the expression un-evaluated, so making the exit value depend
on it seems pretty bulletproof to me.

I suppose though that there's some chance of the constant-argument case
being treated differently from not-constant, so your idea has some merit.
We couldn't use argc/argv however because the autoconf skeleton for
main() doesn't declare 'em.

            regards, tom lane

pgsql-bugs by date:

Previous
From: Tom Lane
Date:
Subject: Re: BUG #2162: Same as bug #1679 - finite() - unresolved symbol
Next
From: "Euler Taveira de Oliveira"
Date:
Subject: BUG #2166: attempted to update invisible tuple