Re: Strange interval arithmetic - Mailing list pgsql-hackers

From Tom Lane
Subject Re: Strange interval arithmetic
Date
Msg-id 1947.1133390993@sss.pgh.pa.us
Whole thread Raw
In response to Re: Strange interval arithmetic  (Michael Fuhr <mike@fuhr.org>)
Responses Re: Strange interval arithmetic  (Michael Fuhr <mike@fuhr.org>)
Re: Strange interval arithmetic  (Andrew Dunstan <andrew@dunslane.net>)
List pgsql-hackers
Michael Fuhr <mike@fuhr.org> writes:
> I suppose if we check for LONG_MAX then we should also check
> for LONG_MIN.

s/should/must/, which makes the code even more complicated, in order to
buy what exactly?

> I don't know if any systems might set ERANGE in a non-error situation.

The SUS saith
http://www.opengroup.org/onlinepubs/007908799/xsh/strtol.html
The strtol() function will not change the setting of errno ifsuccessful.

Perhaps more to the point, we've been doing it that way (errno test
only) for many years without complaints.  Adding a test on the return
value is venturing into less charted waters.
        regards, tom lane


pgsql-hackers by date:

Previous
From: Michael Fuhr
Date:
Subject: Re: Strange interval arithmetic
Next
From: Michael Fuhr
Date:
Subject: Re: Strange interval arithmetic