Re: pgsql: Implement operator class parameters

Поиск
Список
Период
Сортировка
От Alexander Korotkov
Тема Re: pgsql: Implement operator class parameters
Дата
Msg-id CAPpHfdsqPeV4usHas9zvYEuGd2RqNTsmfdQEGoUHtNoY5jg2sQ@mail.gmail.com
обсуждение исходный текст
Ответ на Re: pgsql: Implement operator class parameters  (Andres Freund <andres@anarazel.de>)
Ответы Re: pgsql: Implement operator class parameters
Список pgsql-committers
On Mon, Mar 30, 2020 at 9:36 PM Andres Freund <andres@anarazel.de> wrote:
> This triggers a few new (harmless) warnings for me:
> In file included from /home/andres/src/postgresql/src/include/postgres.h:46,
>                  from /home/andres/src/postgresql/src/backend/access/index/indexam.c:44:
> /home/andres/src/postgresql/src/backend/access/index/indexam.c: In function ‘index_getprocid’:
> /home/andres/src/postgresql/src/backend/access/index/indexam.c:782:17: warning: comparison is always true due to
limitedrange of data type [-Wtype-limits] 
>   782 |  Assert(procnum >= 0 && procnum <= (uint16) nproc);
>       |                 ^~
> /home/andres/src/postgresql/src/backend/access/index/indexam.c:782:2: note: in expansion of macro ‘Assert’
>   782 |  Assert(procnum >= 0 && procnum <= (uint16) nproc);
>       |  ^~~~~~
> /home/andres/src/postgresql/src/backend/access/index/indexam.c: In function ‘index_getprocinfo’:
> /home/andres/src/postgresql/src/backend/access/index/indexam.c:818:17: warning: comparison is always true due to
limitedrange of data type [-Wtype-limits] 
>   818 |  Assert(procnum >= 0 && procnum <= (uint16) nproc);
>       |                 ^~
> /home/andres/src/postgresql/src/include/c.h:782:9: note: in definition of macro ‘Assert’
>   782 |   if (!(condition)) \
>       |         ^~~~~~~~~
> PostgreSQL installation complete.

Thank you!  This reveals to me that this commit contains rudiments of
allowing procnum == 0.  I'll commit the fix soon.

BTW, what version of compiler (and options) do you use?  At the first
glance gcc and clang don't show these warnings to me.

------
Alexander Korotkov
Postgres Professional: http://www.postgrespro.com
The Russian Postgres Company



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

Предыдущее
От: Peter Geoghegan
Дата:
Сообщение: pgsql: Consistently truncate non-key suffix columns.
Следующее
От: Alexander Korotkov
Дата:
Сообщение: pgsql: Remove rudiments of supporting procnum == 0 from 911e702077