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 1tuYe5-009mCD-7v for pgsql-committers@arkaria.postgresql.org; Tue, 18 Mar 2025 15:14:21 +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 1tuYe3-00Gm1O-RL for pgsql-committers@arkaria.postgresql.org; Tue, 18 Mar 2025 15:14:19 +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 1tuYe3-00Gm0K-6W for pgsql-committers@lists.postgresql.org; Tue, 18 Mar 2025 15:14:19 +0000 Received: from fout-b2-smtp.messagingengine.com ([202.12.124.145]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96) (envelope-from ) id 1tuYdz-003aLj-0Y for pgsql-committers@lists.postgresql.org; Tue, 18 Mar 2025 15:14:18 +0000 Received: from phl-compute-12.internal (phl-compute-12.phl.internal [10.202.2.52]) by mailfout.stl.internal (Postfix) with ESMTP id 1CA80114017E; Tue, 18 Mar 2025 11:14:14 -0400 (EDT) Received: from phl-mailfrontend-02 ([10.202.2.163]) by phl-compute-12.internal (MEProxy); Tue, 18 Mar 2025 11:14:14 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=anarazel.de; 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=1742310853; x=1742397253; bh=MQc0cKvKbk a6UruPpiI8f6cydXriahqHWfelqz+T0oA=; b=A3QDL5/cZObzMr6WD+twMoBfnJ j9gYHH/dYGcdrTC4NSURQ8mXYPjisvWG0zvelihD9ujcVmxomc0dP4xL1YPVT/3I Kjt1SR75TsqF1RkZ8jqMnSqWdwEekVHfbJzwxt7+YboAO0S7kRYoEyJcdoGCTMyd IZIPWPYiIEwxG7DpDezx7akz6jybrdNqD3S5mq5cbHxLLu+OCmy0a0/hOwUCKUEB SME0JrIs6T3EsSIvmLSzj6DN0V4ZJgIviIoeHSCrHA/yrPHrcuQQQCY5FgU2ddOL 7HK+OqMTTkc2HKYIswKBx0Do1M6npZqhQ/jEW+TDEnz7qqJkp4N1ul1iirYA== 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= 1742310853; x=1742397253; bh=MQc0cKvKbka6UruPpiI8f6cydXriahqHWfe lqz+T0oA=; b=YRDdrWy66fYEsXqnOcK7o1AHNdljTJx2DsKQRXDIzkA/IPiUQ2g SbWavn1DkIwX1EG9ZZmQVxP/k30jPM0FX3oNAVNA87GXlwuAIBYUYxHsnICEWjcr kD3kNCen2lR8X30oE+S/PJEpNs22ucj6xvS7OYJjYLgdhKHNHc75aJ61+ZVHCrIg vccdiRUQ3ZPpmqfrGIN6ASQNjip3LrDVxrN22bRLfm76SXmAOIV/3P8c5tIF1oZg VJRm5ELtWxpRNMepwvgSNrCPgFAr1BglFUPFy9qP6/Vnj230pN0PCDwpIOrT79w2 4nv/EfbLZVJ7qh7y+fb3nNb4jDK5OZKZ5uQ== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeefvddrtddtgddugedvjeejucetufdoteggodetrf dotffvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdggtfgfnhhsuhgsshgtrhhisggv pdfurfetoffkrfgpnffqhgenuceurghilhhouhhtmecufedttdenucenucfjughrpeffhf fvvefukfhfgggtuggjsehttdfstddttddvnecuhfhrohhmpeetnhgurhgvshcuhfhrvghu nhguuceorghnughrvghssegrnhgrrhgriigvlhdruggvqeenucggtffrrghtthgvrhhnpe effffgledvffegtdevlefgtdeggffhvdekgfegteeiveejkeetudelveejhfeugeenucev lhhushhtvghrufhiiigvpedtnecurfgrrhgrmhepmhgrihhlfhhrohhmpegrnhgurhgvsh esrghnrghrrgiivghlrdguvgdpnhgspghrtghpthhtohepvddpmhhouggvpehsmhhtphho uhhtpdhrtghpthhtohepphhgshhqlhdqtghomhhmihhtthgvrhhssehlihhsthhsrdhpoh hsthhgrhgvshhqlhdrohhrghdprhgtphhtthhopehtghhlsehsshhsrdhpghhhrdhprgdr uhhs X-ME-Proxy: Feedback-ID: id4a34324:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Tue, 18 Mar 2025 11:14:13 -0400 (EDT) Date: Tue, 18 Mar 2025 11:14:12 -0400 From: Andres Freund To: Tom Lane Cc: pgsql-committers@lists.postgresql.org Subject: Re: pgsql: aio: Add core asynchronous I/O infrastructure Message-ID: References: <93029.1742310216@sss.pgh.pa.us> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <93029.1742310216@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk Hi, On 2025-03-18 11:03:36 -0400, Tom Lane wrote: > 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: comparison 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: comparison of constant 1 with expression of type 'PgAioTargetID' (aka 'enum PgAioTargetID') is always true [-Wtautological-constant-out-of-range-compare] > ayu | 2025-03-18 13:08:04 | aio_callback.c:220:56: warning: comparison of constant 1 with expression of type 'PgAioTargetID' (aka 'enum PgAioTargetID') is always true [-Wtautological-constant-out-of-range-compare] > ayu | 2025-03-18 13:08:04 | aio_callback.c:274:56: warning: comparison of constant 1 with expression of type 'PgAioTargetID' (aka 'enum PgAioTargetID') is always true [-Wtautological-constant-out-of-range-compare] > ayu | 2025-03-18 13:08:04 | aio_target.c:50:41: warning: comparison of constant 1 with expression of type 'PgAioTargetID' (aka 'enum PgAioTargetID') is always true [-Wtautological-constant-out-of-range-compare] > ayu | 2025-03-18 13:08:04 | aio_target.c:110:41: warning: comparison of constant 1 with expression of type 'PgAioTargetID' (aka 'enum PgAioTargetID') is always true [-Wtautological-constant-out-of-range-compare] > demoiselle | 2025-03-18 03:43:46 | aio_callback.c:83:12: warning: comparison 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: comparison of constant 1 with expression of type 'PgAioTargetID' (aka 'enum PgAioTargetID') is always true [-Wtautological-constant-out-of-range-compare] > demoiselle | 2025-03-18 03:43:46 | aio_callback.c:220:56: warning: comparison of constant 1 with expression of type 'PgAioTargetID' (aka 'enum PgAioTargetID') is always true [-Wtautological-constant-out-of-range-compare] > demoiselle | 2025-03-18 03:43:46 | aio_callback.c:274:56: warning: comparison of constant 1 with expression of type 'PgAioTargetID' (aka 'enum PgAioTargetID') is always true [-Wtautological-constant-out-of-range-compare] > demoiselle | 2025-03-18 03:43:46 | aio_target.c:50:41: warning: comparison of constant 1 with expression of type 'PgAioTargetID' (aka 'enum PgAioTargetID') is always true [-Wtautological-constant-out-of-range-compare] > demoiselle | 2025-03-18 03:43:46 | aio_target.c:110:41: warning: comparison of constant 1 with expression of type 'PgAioTargetID' (aka 'enum PgAioTargetID') is always true [-Wtautological-constant-out-of-range-compare] Thanks for noticing that. > I don't have that compiler handy to check, but maybe changes like > > - if (cb_id >= lengthof(aio_handle_cbs)) > + if ((size_t) cb_id >= lengthof(aio_handle_cbs)) > > would silence these? I wonder if we should instead either ask those buildfarm animals to be disabled or have the warning manually disabled. I don't think it's a good investment on our part to work towards warning cleanliness on clang 4 and 5, on distros from 2017 and and 2018 respectively. > Or you could just drop all those tests and have faith in the type-safety of > the enums. The issue isn't really the type-safety of the enums (not that I would have a lot of trust in that), it's whether the relevant callback/target actually have been added to the the callback/target arrays. Greetings, Andres Freund