inet data type regression test fails

Поиск
Список
Период
Сортировка
От Tatsuo Ishii
Тема inet data type regression test fails
Дата
Msg-id 199902220254.LAA04354@srapc451.sra.co.jp
обсуждение исходный текст
Ответы Re: [HACKERS] inet data type regression test fails  (Tatsuo Ishii <t-ishii@sra.co.jp>)
Re: [HACKERS] inet data type regression test fails  (Bruce Momjian <maillist@candle.pha.pa.us>)
Re: [HACKERS] inet data type regression test fails  (Bruce Momjian <maillist@candle.pha.pa.us>)
Список pgsql-hackers
Hi all,

The inet regression test has been failed on my LinuxPPC. While
investigating the reason, I found a code that doesn't work on
LinuxPPC. From network_broadcast() in utils/adt/network.c:

int    addr = htonl(ntohl(ip_v4addr(ip)) | (0xffffffff >> ip_bits(ip)));

Here ip_bits() returns from (unsigned char)0 to 32. My question is:
what is the correct result of (0xffffffff >> ip_bits())?

1. 0x0
2. 0xffffffff (actually does nothing)

LinuxPPC is 1. FreeBSD and Solaris are 2. network_broadcast() seems to
expect 2. My guess is shifting over 32bit against a 32bit integer is
not permitted and the result is platform depedent. If this would true,
it could be said that network_broadcast() has a portabilty
problem. Comments?
---
Tatsuo Ishii


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

Предыдущее
От: Bruce Momjian
Дата:
Сообщение: Re: [HACKERS] Re: Max backend limits cleaned up
Следующее
От: "Thomas G. Lockhart"
Дата:
Сообщение: Re: [COMMITTERS] 'pgsql/src/test/regress/expected rules.out'