Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1qZH4g-004oSd-DX for pgsql-committers@arkaria.postgresql.org; Thu, 24 Aug 2023 20:37:02 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.94.2) (envelope-from ) id 1qZH4e-00CnvT-5D for pgsql-committers@arkaria.postgresql.org; Thu, 24 Aug 2023 20:36:59 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1qZH4d-00CnvL-Te for pgsql-committers@lists.postgresql.org; Thu, 24 Aug 2023 20:36:59 +0000 Received: from relay7-d.mail.gandi.net ([217.70.183.200]) by magus.postgresql.org with esmtps (TLS1.2) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1qZH4Z-000qOW-Vz for pgsql-committers@lists.postgresql.org; Thu, 24 Aug 2023 20:36:58 +0000 Received: by mail.gandi.net (Postfix) with ESMTPSA id A51FF20003; Thu, 24 Aug 2023 20:36:53 +0000 (UTC) Content-Type: multipart/alternative; boundary="------------foZqNmbt7PUs5aBN56mJiDOt" Message-ID: Date: Thu, 24 Aug 2023 16:36:51 -0400 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.5.0 Content-Language: en-US To: Tom Lane Cc: pgsql-committers@lists.postgresql.org References: <3907902.1692890821@sss.pgh.pa.us> From: Andrew Dunstan Subject: Re: pgsql: Cache by-reference missing values in a long lived context In-Reply-To: <3907902.1692890821@sss.pgh.pa.us> X-GND-Sasl: adsend@dunslane.net List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk This is a multi-part message in MIME format. --------------foZqNmbt7PUs5aBN56mJiDOt Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit On 2023-08-24 Th 11:27, Tom Lane wrote: > Andrew Dunstan writes: >> Cache by-reference missing values in a long lived context > The v11 version of this patch is causing a compiler warning for me: > > In file included from heaptuple.c:58: > heaptuple.c: In function 'missing_hash': > heaptuple.c:97:3: warning: implicit declaration of function 'hash_any'; did you mean 'hash_stats'? [-Wimplicit-function-declaration] > hash_any((const unsigned char *) entry->value, entry->len)); > ^~~~~~~~ > ../../../../src/include/postgres.h:471:38: note: in definition of macro 'DatumGetUInt32' > #define DatumGetUInt32(X) ((uint32) (X)) > ^ > > It seems to work anyway, but please fix. Sorry about that, fixed. While we're about it, let's also fix these warnings which are seen on my systems building releases 11 and 12: /home/andrew/bf/root/REL_11_STABLE/pgsql.build/../pgsql/src/backend/commands/foreigncmds.c:481:22: warning: ‘funcargtypes’ may be used uninitialized [-Wmaybe-uninitialized] /home/andrew/bf/root/REL_12_STABLE/pgsql.build/../pgsql/src/backend/commands/foreigncmds.c:487:22: warning: ‘funcargtypes’ may be used uninitialized [-Wmaybe-uninitialized] Maybe funcargtypes here should be initialized to  { 0 } ? cheers andrew -- Andrew Dunstan EDB:https://www.enterprisedb.com --------------foZqNmbt7PUs5aBN56mJiDOt Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: 8bit


On 2023-08-24 Th 11:27, Tom Lane wrote:
Andrew Dunstan <andrew@dunslane.net> writes:
Cache by-reference missing values in a long lived context
The v11 version of this patch is causing a compiler warning for me:

In file included from heaptuple.c:58:
heaptuple.c: In function 'missing_hash':
heaptuple.c:97:3: warning: implicit declaration of function 'hash_any'; did you mean 'hash_stats'? [-Wimplicit-function-declaration]
   hash_any((const unsigned char *) entry->value, entry->len));
   ^~~~~~~~
../../../../src/include/postgres.h:471:38: note: in definition of macro 'DatumGetUInt32'
 #define DatumGetUInt32(X) ((uint32) (X))
                                      ^

It seems to work anyway, but please fix.



Sorry about that, fixed.

While we're about it, let's also fix these warnings which are seen on my systems building releases 11 and 12:

/home/andrew/bf/root/REL_11_STABLE/pgsql.build/../pgsql/src/backend/commands/foreigncmds.c:481:22: warning: ‘funcargtypes’ may be used uninitialized [-Wmaybe-uninitialized]
/home/andrew/bf/root/REL_12_STABLE/pgsql.build/../pgsql/src/backend/commands/foreigncmds.c:487:22: warning: ‘funcargtypes’ may be used uninitialized [-Wmaybe-uninitialized]

Maybe funcargtypes here should be initialized to  { 0 } ?


cheers


andrew

--
Andrew Dunstan
EDB: https://www.enterprisedb.com
--------------foZqNmbt7PUs5aBN56mJiDOt--