Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1oqbY1-0006Yj-3D for pgsql-hackers@arkaria.postgresql.org; Thu, 03 Nov 2022 14:50:25 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1oqbXz-0001Wz-Jt for pgsql-hackers@arkaria.postgresql.org; Thu, 03 Nov 2022 14:50:23 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1oqbXz-0001Wo-AD for pgsql-hackers@lists.postgresql.org; Thu, 03 Nov 2022 14:50:23 +0000 Received: from sss.pgh.pa.us ([66.207.139.130]) by magus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1oqbXw-0005Rf-9l for pgsql-hackers@lists.postgresql.org; Thu, 03 Nov 2022 14:50:22 +0000 Received: from sss1.sss.pgh.pa.us (localhost [127.0.0.1]) by sss.pgh.pa.us (8.15.2/8.15.2) with ESMTP id 2A3EoIEv2063438; Thu, 3 Nov 2022 10:50:18 -0400 From: Tom Lane To: David Geier cc: PostgreSQL Developers Subject: Re: Add explicit casts in four places to simplehash.h In-reply-to: References: Comments: In-reply-to David Geier message dated "Thu, 03 Nov 2022 12:34:41 +0100" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <2063436.1667487018.1@sss.pgh.pa.us> Date: Thu, 03 Nov 2022 10:50:18 -0400 Message-ID: <2063437.1667487018@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk David Geier writes: > What about, while not being strictly necessary for PostgreSQL itself, > also adding such casts to simplehash.h so that it can be used in code > where -Wc++-compat is enabled? Seems reasonable, so done (I fixed one additional spot you missed). The bigger picture here is that we do actually endeavor to keep (most of) our headers C++ clean, but our tool cpluspluscheck misses these problems because it doesn't try to use these macros. I wonder whether there is a way to do better. regards, tom lane