Re: PostgreSQL pre-7.1 Linux/Alpha Status...

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: PostgreSQL pre-7.1 Linux/Alpha Status...
Дата
Msg-id 18463.977421395@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Re: PostgreSQL pre-7.1 Linux/Alpha Status...  (Peter Eisentraut <peter_e@gmx.net>)
Ответы Re: PostgreSQL pre-7.1 Linux/Alpha Status...  (Peter Eisentraut <peter_e@gmx.net>)
Список pgsql-hackers
Peter Eisentraut <peter_e@gmx.net> 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


В списке pgsql-hackers по дате отправления:

Предыдущее
От: "Rod Taylor"
Дата:
Сообщение: Inline Comments for pg_dump
Следующее
От: Hannu Krosing
Дата:
Сообщение: Re: Who is a maintainer of GiST code ?