Re: [HACKERS] PostgreSQL pre-7.1 Linux/Alpha Status...

From: Peter Eisentraut <peter_e(at)gmx(dot)net>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: Ryan Kirkpatrick <pgsql(at)rkirkpat(dot)net>, <pgsql-hackers(at)postgresql(dot)org>, <pgsql-ports(at)postgresql(dot)org>
Subject: Re: [HACKERS] PostgreSQL pre-7.1 Linux/Alpha Status...
Date: 2000-12-21 18:41:41
Message-ID: Pine.LNX.4.30.0012211934500.775-100000@peter.localdomain
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers pgsql-ports

Tom Lane writes:

> > if (sizeof(unsigned long) > sizeof(Oid) && cvt > UINT_MAX)
>
> Hm. Each part of that will generate "expression is always false"
> warnings from certain overprotective compilers.

Any compiler that does this will certainly issue a boatload of these all
over the tree. More generally, I have given up on worrying too much about
the warning count on non-GCC compilers. All the ones I've seen lately
generate tons already.

> A more serious problem is that using UINT_MAX assumes that Oid is
> unsigned int, which will certainly not be true forever --- but the
> required change will be easily missed when Oid changes.
>
> Perhaps postgres_ext.h could define
>
> #define OID_MAX UINT_MAX
>
> right below the typedef for Oid, and then we could do this in oidin():
>
> #if OID_MAX < ULONG_MAX
> if (cvt > OID_MAX)
> elog();
> #endif

That looks fine as well.

--
Peter Eisentraut peter_e(at)gmx(dot)net http://yi.org/peter-e/

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message mlw 2000-12-21 18:44:59 Re: Three types of functions, ala function redux.
Previous Message Peter Eisentraut 2000-12-21 18:30:14 Re: Status of JDBC Interface

Browse pgsql-ports by date

  From Date Subject
Next Message Jason Tishler 2000-12-21 19:27:22 Cygwin PostgreSQL postmaster abort problem
Previous Message Tom Lane 2000-12-21 17:56:35 Re: PostgreSQL pre-7.1 Linux/Alpha Status...