Peter Eisentraut <[EMAIL PROTECTED]> 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. 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
I think this #if expression will work --- anyone see any portability
risk there?
regards, tom lane
- [HACKERS] PostgreSQL pre-7.1 Linux/Alpha Status... Ryan Kirkpatrick
- Re: [HACKERS] PostgreSQL pre-7.1 Linux/Alpha Sta... Tom Lane
- Re: [HACKERS] PostgreSQL pre-7.1 Linux/Alpha... Magnus Naeslund\(f\)
- Re: [HACKERS] PostgreSQL pre-7.1 Linux/Alpha... Bruce Momjian
- Re: [HACKERS] PostgreSQL pre-7.1 Linux/Alpha... Ryan Kirkpatrick
- Re: [HACKERS] PostgreSQL pre-7.1 Linux/Alpha... Peter Eisentraut
- Re: [HACKERS] PostgreSQL pre-7.1 Linux/A... Tom Lane
- Re: [HACKERS] PostgreSQL pre-7.1 Lin... Peter Eisentraut
- [HACKERS] Re: [PORTS] PostgreSQL pre-7.1 Linux/A... Bruce Momjian
- [HACKERS] Re: [PORTS] PostgreSQL pre-7.1 Lin... Ryan Kirkpatrick
