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 1rmoeN-00A18x-0k for pgsql-hackers@arkaria.postgresql.org; Wed, 20 Mar 2024 05:38:07 +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 1rmoeK-002fOL-RN for pgsql-hackers@arkaria.postgresql.org; Wed, 20 Mar 2024 05:38:05 +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 1rmoeK-002fOD-Hz for pgsql-hackers@lists.postgresql.org; Wed, 20 Mar 2024 05:38:05 +0000 Received: from sss.pgh.pa.us ([68.162.161.243]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1rmoeH-005RjV-9V for pgsql-hackers@postgresql.org; Wed, 20 Mar 2024 05:38:03 +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 42K5bl1h4119681; Wed, 20 Mar 2024 01:37:47 -0400 From: Tom Lane To: Heikki Linnakangas cc: pgsql-hackers , reid.thompson@crunchydata.com, Thomas Munro , Robert Haas , Andres Freund , Tristan Partin Subject: Re: Refactoring backend fork+exec code In-reply-to: <47965166-073f-49c8-9e8d-fd6ba37c61fb@iki.fi> References: <59527c9b-c3f7-4d0c-a3f1-00d0ed5cc186@iki.fi> <20240122210740.7vq5fd4woixpwx3f@awork3.anarazel.de> <8171f1aa-496f-46a6-afc3-c46fe7a9b407@iki.fi> <20240123195009.44wtutga24p5sh3s@awork3.anarazel.de> <08eff756-beeb-4a11-9eb5-d45b6af38998@iki.fi> <5997ff317a5827496537580078bcd19f4441f8d2.camel@crunchydata.com> <606a62d6-321c-4967-92c1-2d4e20a2c136@iki.fi> <20240207182521.wyt5dmd75l4v27zk@awork3.anarazel.de> <2136fb4f-1630-43e9-9cf6-b32772b4b0a0@iki.fi> <20240214213711.2gjlezqll37mg7lg@awork3.anarazel.de> <8f695109-8341-4f7c-8b0d-3cadc7eddc9e@iki.fi> <0c247a78-9dac-4584-8e87-39f2b45bec68@iki.fi> <861f42c1-01c4-42e6-ab2f-d5743ff69607@iki.fi> <53a0a952-1b58-4346-941c-6b767108963a@iki.fi> <47965166-073f-49c8-9e8d-fd6ba37c61fb@iki.fi> Comments: In-reply-to Heikki Linnakangas message dated "Mon, 18 Mar 2024 11:41:41 +0200" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <4119679.1710913067.1@sss.pgh.pa.us> Content-Transfer-Encoding: quoted-printable Date: Wed, 20 Mar 2024 01:37:47 -0400 Message-ID: <4119680.1710913067@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk Heikki Linnakangas writes: > Committed, with some final cosmetic cleanups. Thanks everyone! A couple of buildfarm animals don't like these tests: Assert(child_type >=3D 0 && child_type < lengthof(child_process_kinds)); for example ayu | 2024-03-19 13:08:05 | launch_backend.c:211:39: warning: c= omparison of constant 16 with expression of type 'BackendType' (aka 'enum = BackendType') is always true [-Wtautological-constant-out-of-range-compare= ] ayu | 2024-03-19 13:08:05 | launch_backend.c:233:39: warning: c= omparison of constant 16 with expression of type 'BackendType' (aka 'enum = BackendType') is always true [-Wtautological-constant-out-of-range-compare= ] I'm not real sure why it's moaning about the "<" check but not the ">=3D 0" check, which ought to be equally tautological given the assumption that the input is a valid member of the enum. But in any case, exactly how much value do these assertions carry? If you're intent on keeping them, perhaps casting child_type to int here would suppress the warnings. But personally I think I'd lose the Asserts. regards, tom lane