pg.ddx.io  pgsql-committers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Alexander Korotkov <a.korotkov@postgrespro.ru>
To: Andres Freund <andres@anarazel.de>
Cc: Alexander Korotkov <akorotkov@postgresql.org>
Cc: pgsql-committers <pgsql-committers@lists.postgresql.org>
Subject: Re: pgsql: Implement operator class parameters
Date: Mon, 30 Mar 2020 23:11:06 +0300
Message-ID: <CAPpHfdsqPeV4usHas9zvYEuGd2RqNTsmfdQEGoUHtNoY5jg2sQ@mail.gmail.com> (raw)
In-Reply-To: <20200330183614.qrfi7zipcqiztpti@alap3.anarazel.de>
References: <E1jIx6n-0002De-QB@gemulon.postgresql.org>
	<20200330183614.qrfi7zipcqiztpti@alap3.anarazel.de>

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 limited range 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 limited range 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





view thread (4+ messages)  latest in thread

Message-ID: <CAPpHfdsqPeV4usHas9zvYEuGd2RqNTsmfdQEGoUHtNoY5jg2sQ@mail.gmail.com>
Permalink:  ../CAPpHfdsqPeV4usHas9zvYEuGd2RqNTsmfdQEGoUHtNoY5jg2sQ@mail.gmail.com/
Also on:    postgresql.org/message-id/CAPpHfdsqPeV4usHas9zvYEuGd2RqNTsmfdQEGoUHtNoY5jg2sQ@mail.gmail.com

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-committers@postgresql.org
  Cc: a.korotkov@postgrespro.ru, andres@anarazel.de, akorotkov@postgresql.org
  Subject: Re: pgsql: Implement operator class parameters
  In-Reply-To: <CAPpHfdsqPeV4usHas9zvYEuGd2RqNTsmfdQEGoUHtNoY5jg2sQ@mail.gmail.com>
  References: <E1jIx6n-0002De-QB@gemulon.postgresql.org> <20200330183614.qrfi7zipcqiztpti@alap3.anarazel.de> <CAPpHfdsqPeV4usHas9zvYEuGd2RqNTsmfdQEGoUHtNoY5jg2sQ@mail.gmail.com>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox