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 1v10ru-003Zu8-Pg for pgsql-hackers@arkaria.postgresql.org; Tue, 23 Sep 2025 11:07:35 +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 1v10rs-0052z2-MZ for pgsql-hackers@arkaria.postgresql.org; Tue, 23 Sep 2025 11:07:32 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1v10rr-0052ys-Vw for pgsql-hackers@lists.postgresql.org; Tue, 23 Sep 2025 11:07:32 +0000 Received: from fout-a7-smtp.messagingengine.com ([103.168.172.150]) by makus.postgresql.org with smtp (Exim 4.96) (envelope-from ) id 1v10rp-001va9-0t for pgsql-hackers@lists.postgresql.org; Tue, 23 Sep 2025 11:07:30 +0000 Received: from phl-compute-10.internal (phl-compute-10.internal [10.202.2.50]) by mailfout.phl.internal (Postfix) with ESMTP id D88F5EC0090; Tue, 23 Sep 2025 07:07:28 -0400 (EDT) Received: from phl-mailfrontend-02 ([10.202.2.163]) by phl-compute-10.internal (MEProxy); Tue, 23 Sep 2025 07:07:28 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=paquier.xyz; h= cc:cc:content-type:content-type:date:date:from:from:in-reply-to :in-reply-to:message-id:mime-version:references:reply-to:subject :subject:to:to; s=fm1; t=1758625648; x=1758712048; bh=Pp33mqFstv 4jmdXdWHM508Mdkbf4GI0bmmJVdt8lAxA=; b=HPvHlTp7kZwJVHw6/vbekUDuoT w5tz75EvOmFdu/0FGA++70pE2Tt+I/TzAtpq6VTpTC2OUtA7ZE49lY5j9PvN3ZMg T6qaWiUqI+1tOUpnoWk8hluUIgM5TOJMvunZsF2WV0Pht9vNDM2mRMs5YZwJk3XP c3UqqFFrbI3T0TbNRMTQwVE9KQl2VkuiwtN0++TeSRjzPD5Is07t6hg2Oy83B/jD mRYKhGt8yWVOfdF8nPNOIoS/1VGtwcYxVo7TAYAE9JSvZuZFD/2V+2ziV53AJE51 c0kScf8RVoJSDuGHsVHC9Yhi8Qdld4ZOTotXXYwqdYZYRWTS75BP2r4F2wBg== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-type:content-type:date:date :feedback-id:feedback-id:from:from:in-reply-to:in-reply-to :message-id:mime-version:references:reply-to:subject:subject:to :to:x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s=fm1; t= 1758625648; x=1758712048; bh=Pp33mqFstv4jmdXdWHM508Mdkbf4GI0bmmJ Vdt8lAxA=; b=OfOXeq6pFPsW2A5yQq0cn637kdfgFpx+a7otDSqgph5RS9dERwJ 0fxbl3SGdakfjuDYvUWKOepugTYEI2Rupg8/twGBFozZ331Uk58YY5qbjuvvP6R+ uZOipfTvDTeJWU96LBhsuyhVWVdTwiLo+G2nE7dwtfbmtc4ngoVM5cb70nqnk/0W m1yyHBZWqsUB0TxBFR+mrWi3y2QjESGqMHSol0TRQklB0OywzrtvhwHtSBnOXo0o jdlyc9PFWfvTbjr0vpdUQnXk0G4EQNvyqmiNd0whciH40gtNAUvWeIbv9YSMSVp8 MlcJTX4RRXbZ2McdbyFG9+cGdubJGdCq7ZA== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeeffedrtdeggdeitdehiecutefuodetggdotefrod ftvfcurfhrohhfihhlvgemucfhrghsthforghilhdpuffrtefokffrpgfnqfghnecuuegr ihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenfghrlh cuvffnffculdefhedmnecujfgurhepfffhvfevuffkfhggtggujgesghdtreertddtvden ucfhrhhomhepofhitghhrggvlhcurfgrqhhuihgvrhcuoehmihgthhgrvghlsehprghquh hivghrrdighiiiqeenucggtffrrghtthgvrhhnpeegffejvefgveduvdejtddvtdeijeeh udeuledvudeftdfgfeejvdekveekiedvvdenucffohhmrghinhepphhoshhtghhrvghsqh hlrdhorhhgnecuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehmrghilhhfrhho mhepmhhitghhrggvlhesphgrqhhuihgvrhdrgiihiidpnhgspghrtghpthhtohepiedpmh houggvpehsmhhtphhouhhtpdhrtghpthhtohepthhglhesshhsshdrphhghhdrphgrrdhu shdprhgtphhtthhopehgrhgvghessghurhgurdhmvgdprhgtphhtthhopehpghhsqhhlqd hhrggtkhgvrhhssehlihhsthhsrdhpohhsthhgrhgvshhqlhdrohhrghdprhgtphhtthho pehrohgsvghrthhmhhgrrghssehgmhgrihhlrdgtohhmpdhrtghpthhtohepnhgrthhhrg hnuggsohhsshgrrhhtsehgmhgrihhlrdgtohhmpdhrtghpthhtohepshgrfigruggrrdhm shhhkhesghhmrghilhdrtghomh X-ME-Proxy: Feedback-ID: i0fe9450f:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Tue, 23 Sep 2025 07:07:26 -0400 (EDT) Date: Tue, 23 Sep 2025 20:07:13 +0900 From: Michael Paquier To: Tom Lane Cc: Greg Burd , PostgreSQL Hackers , Robert Haas , Nathan Bossart , Masahiko Sawada Subject: Re: [PATCH] Add tests for Bitmapset Message-ID: References: <3027069.1758606227@sss.pgh.pa.us> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="W6Pl0JLkymAph1EC" Content-Disposition: inline In-Reply-To: <3027069.1758606227@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk --W6Pl0JLkymAph1EC Content-Type: multipart/mixed; boundary="cARV34OOUCvkdZPx" Content-Disposition: inline --cARV34OOUCvkdZPx Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Tue, Sep 23, 2025 at 01:43:47AM -0400, Tom Lane wrote: > Michael Paquier writes: >> The result I had was good enough, so applied. The CI was OK, the >> buildfarm may have a different opinion. >=20 > This patch seems to be rather full of arbitrary casts to or > from Datum, which is no longer okay. You need to be using > the appropriate conversion macros, such as PointerGetDatum. >=20 > https://buildfarm.postgresql.org/cgi-bin/show_log.pl?nm=3Dmamba&dt=3D2025= -09-23%2002%3A12%3A36 Right, this can ve reproduced with a -m32 added to gcc. I don't see a need for a Datum manipulation in these conversion macros, as we already allocate the results to and from "text" before/after using the GETARG or RETURN macros. Using directly text_to_cstring() and cstring_to_text() takes care of the warnings, as well. -- Michael --cARV34OOUCvkdZPx Content-Type: text/x-diff; charset=us-ascii Content-Disposition: attachment; filename="test_bitmapset-warnings.patch" Content-Transfer-Encoding: quoted-printable diff --git a/src/test/modules/test_bitmapset/test_bitmapset.c b/src/test/mo= dules/test_bitmapset/test_bitmapset.c index 61f256f65a44..f5473e58ce8e 100644 --- a/src/test/modules/test_bitmapset/test_bitmapset.c +++ b/src/test/modules/test_bitmapset/test_bitmapset.c @@ -84,8 +84,8 @@ PG_FUNCTION_INFO_V1(test_random_operations); } while (0) =20 /* Encode/Decode to/from TEXT and Bitmapset */ -#define BITMAPSET_TO_TEXT(bms) (text *) CStringGetTextDatum(nodeToString((= bms))) -#define TEXT_TO_BITMAPSET(str) (Bitmapset *) stringToNode(TextDatumGetCStr= ing((Datum) (str))) +#define BITMAPSET_TO_TEXT(bms) cstring_to_text(nodeToString((bms))) +#define TEXT_TO_BITMAPSET(str) (Bitmapset *) stringToNode(text_to_cstring(= str)) =20 /* * Individual test functions for each bitmapset API function --cARV34OOUCvkdZPx-- --W6Pl0JLkymAph1EC Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAABCgAdFiEEG72nH6vTowiyblFKnvQgOdbyQH0FAmjSf2EACgkQnvQgOdby QH0cXg//bgSwpGAaUL/Q/E4xkaVNZ9unJFWNTLQbzzPKWaGtN0udhJqYLljA2wN4 pn0RXxUhqZMy7LwdugcRpl+RJUhr0yE5srNbEXGZ2epSd/JwUgC2Fy+99ygF51RS +f+iu20gbzSLP9SaaOOIiC1vLHADhMI88qTHYqmy5hER5L8UloI9U3MMWjKzzxiP eBKvm7gwKADmBYSfjz/Amhpa3QyumcVAJFXE/o+tuBPv53UOvy/GvnS6fyyxEKCS J5lUrErZlS0eKpenQ5nYtQFr1M4orwVSwc6XjXZBFiGGh3vkK2jfqeqtoMDaf2j0 7Iis7TZ1PG8dnxIfMMj6/iAN0BCUrVDqVFx4hWwqAc4TAo1udSQTTMaU59jVX5gl 7Z4BvzHuzpL3ukbLnx+IP13UERTzoK5JPC5ugYU6XbBi3TO02X3pHod6og85rx8Z xRyLdbW1I0WDxneNis4aFT1TN/oLxaNJAKXi6MflEUIrBWiXPS67/xxTqJh5xED0 Oi0neddT+SQopgqVTU1yOFFYUqdvwsmUywgTDkn8l+6gmgoV1Oxn7Z9dP0/EDYUp TCJd7Sct71HiuOvzdmCoG9NSLwO8l+xYBMm5p57C8V6k/M3EgtqxZ1OS7Qt0hefG jqvebTpKnqMq7R+K12Hkf/yJm6btoSxw58mn3IyuC4uzwdMeXkI= =Uy9z -----END PGP SIGNATURE----- --W6Pl0JLkymAph1EC--