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 1tuYTp-009kkg-7o for pgsql-committers@arkaria.postgresql.org; Tue, 18 Mar 2025 15:03:45 +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 1tuYTm-00GTsd-UC for pgsql-committers@arkaria.postgresql.org; Tue, 18 Mar 2025 15:03:42 +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 1tuYTm-00GTsT-Ks for pgsql-committers@lists.postgresql.org; Tue, 18 Mar 2025 15:03:42 +0000 Received: from sss.pgh.pa.us ([68.162.161.243]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96) (envelope-from ) id 1tuYTi-003aGQ-2S for pgsql-committers@lists.postgresql.org; Tue, 18 Mar 2025 15:03:42 +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 52IF3akV093030; Tue, 18 Mar 2025 11:03:37 -0400 From: Tom Lane To: Andres Freund cc: pgsql-committers@lists.postgresql.org Subject: Re: pgsql: aio: Add core asynchronous I/O infrastructure In-reply-to: References: Comments: In-reply-to Andres Freund message dated "Mon, 17 Mar 2025 23:23:42 -0000" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <93028.1742310216.1@sss.pgh.pa.us> Content-Transfer-Encoding: quoted-printable Date: Tue, 18 Mar 2025 11:03:36 -0400 Message-ID: <93029.1742310216@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk Andres Freund writes: > aio: Add core asynchronous I/O infrastructure Some of the buildfarm is mildly unhappy with this. So far I see ayu | 2025-03-18 13:08:04 | aio_callback.c:83:12: warning: comp= arison of constant 1 with expression of type 'PgAioHandleCallbackID' (aka = 'enum PgAioHandleCallbackID') is always false [-Wtautological-constant-out= -of-range-compare] ayu | 2025-03-18 13:08:04 | aio_callback.c:190:56: warning: com= parison of constant 1 with expression of type 'PgAioTargetID' (aka 'enum P= gAioTargetID') is always true [-Wtautological-constant-out-of-range-compar= e] ayu | 2025-03-18 13:08:04 | aio_callback.c:220:56: warning: com= parison of constant 1 with expression of type 'PgAioTargetID' (aka 'enum P= gAioTargetID') is always true [-Wtautological-constant-out-of-range-compar= e] ayu | 2025-03-18 13:08:04 | aio_callback.c:274:56: warning: com= parison of constant 1 with expression of type 'PgAioTargetID' (aka 'enum P= gAioTargetID') is always true [-Wtautological-constant-out-of-range-compar= e] ayu | 2025-03-18 13:08:04 | aio_target.c:50:41: warning: compar= ison of constant 1 with expression of type 'PgAioTargetID' (aka 'enum PgAi= oTargetID') is always true [-Wtautological-constant-out-of-range-compare] ayu | 2025-03-18 13:08:04 | aio_target.c:110:41: warning: compa= rison of constant 1 with expression of type 'PgAioTargetID' (aka 'enum PgA= ioTargetID') is always true [-Wtautological-constant-out-of-range-compare] demoiselle | 2025-03-18 03:43:46 | aio_callback.c:83:12: warning: comp= arison of constant 1 with expression of type 'PgAioHandleCallbackID' (aka = 'enum PgAioHandleCallbackID') is always false [-Wtautological-constant-out= -of-range-compare] demoiselle | 2025-03-18 03:43:46 | aio_callback.c:190:56: warning: com= parison of constant 1 with expression of type 'PgAioTargetID' (aka 'enum P= gAioTargetID') is always true [-Wtautological-constant-out-of-range-compar= e] demoiselle | 2025-03-18 03:43:46 | aio_callback.c:220:56: warning: com= parison of constant 1 with expression of type 'PgAioTargetID' (aka 'enum P= gAioTargetID') is always true [-Wtautological-constant-out-of-range-compar= e] demoiselle | 2025-03-18 03:43:46 | aio_callback.c:274:56: warning: com= parison of constant 1 with expression of type 'PgAioTargetID' (aka 'enum P= gAioTargetID') is always true [-Wtautological-constant-out-of-range-compar= e] demoiselle | 2025-03-18 03:43:46 | aio_target.c:50:41: warning: compar= ison of constant 1 with expression of type 'PgAioTargetID' (aka 'enum PgAi= oTargetID') is always true [-Wtautological-constant-out-of-range-compare] demoiselle | 2025-03-18 03:43:46 | aio_target.c:110:41: warning: compa= rison of constant 1 with expression of type 'PgAioTargetID' (aka 'enum PgA= ioTargetID') is always true [-Wtautological-constant-out-of-range-compare] I don't have that compiler handy to check, but maybe changes like - if (cb_id >=3D lengthof(aio_handle_cbs)) + if ((size_t) cb_id >=3D lengthof(aio_handle_cbs)) would silence these? Or you could just drop all those tests and have faith in the type-safety of the enums. regards, tom lane