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

Peripheral Links

Header And Logo

PostgreSQL
| The world's most advanced open source database.

Site Navigation

Search for
  Advanced Search

Re: Strange interval arithmetic


  • From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
  • To: Michael Fuhr <mike(at)fuhr(dot)org>
  • Cc: Christopher Kings-Lynne <chriskl(at)familyhealth(dot)com(dot)au>, PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>
  • Subject: Re: Strange interval arithmetic
  • Date: Wed, 30 Nov 2005 17:49:53 -0500
  • Message-id: <1947(dot)1133390993(at)sss(dot)pgh(dot)pa(dot)us>

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.

			regards, tom lane



Home | Main Index | Thread Index

Privacy Policy | PostgreSQL Archives hosted by Command Prompt, Inc. | Designed by tinysofa
Copyright © 1996 – 2008 PostgreSQL Global Development Group