Skip site navigation (1) Skip section navigation (2)

Re: Strange interval arithmetic

From: Andrew Dunstan <andrew(at)dunslane(dot)net>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: Michael Fuhr <mike(at)fuhr(dot)org>, Christopher Kings-Lynne <chriskl(at)familyhealth(dot)com(dot)au>, PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Strange interval arithmetic
Date: 2005-11-30 23:00:07
Message-ID: 438E2EF7.7060000@dunslane.net (view raw or flat)
Thread:
Lists: pgsql-hackerspgsql-patches

Tom Lane wrote:

>Michael Fuhr <mike(at)fuhr(dot)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 if
>	successful.
>
>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.
>
>
>  
>

LONG_MIN/LONG_MAX might be the actual values provided, too, mightn't 
they? checking for ERANGE seems like the only viable test.

cheers

andrew

In response to

Responses

pgsql-hackers by date

Next:From: Michael FuhrDate: 2005-11-30 23:15:33
Subject: Re: Strange interval arithmetic
Previous:From: Michael FuhrDate: 2005-11-30 22:57:42
Subject: Re: Strange interval arithmetic

pgsql-patches by date

Next:From: Michael FuhrDate: 2005-11-30 23:15:33
Subject: Re: Strange interval arithmetic
Previous:From: Michael FuhrDate: 2005-11-30 22:57:42
Subject: Re: Strange interval arithmetic

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group