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 1pCkMI-0007Yz-Fp for pgsql-hackers@arkaria.postgresql.org; Tue, 03 Jan 2023 16:41:50 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1pCkMH-0005U8-3b for pgsql-hackers@arkaria.postgresql.org; Tue, 03 Jan 2023 16:41:49 +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 1pCkMG-0005Tz-QP for pgsql-hackers@lists.postgresql.org; Tue, 03 Jan 2023 16:41:48 +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 1pCkMA-0005n3-9K for pgsql-hackers@postgresql.org; Tue, 03 Jan 2023 16:41:48 +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 303Gfbph1776288; Tue, 3 Jan 2023 11:41:37 -0500 From: Tom Lane To: Paul Ramsey cc: Michael Paquier , Justin Pryzby , pgsql-hackers@postgresql.org Subject: Re: [PATCH] random_normal function In-reply-to: <1682143.1672713508@sss.pgh.pa.us> References: <20221208224623.GQ27893@telsasoft.com> <20221231035804.GJ1153@telsasoft.com> <1682143.1672713508@sss.pgh.pa.us> Comments: In-reply-to Tom Lane message dated "Mon, 02 Jan 2023 21:38:28 -0500" MIME-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Content-ID: <1776286.1672764097.1@sss.pgh.pa.us> Content-Transfer-Encoding: 8bit Date: Tue, 03 Jan 2023 11:41:37 -0500 Message-ID: <1776287.1672764097@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk I wrote: > Michael Paquier writes: >> FYI, here is the failure: >> [21:23:10.814] In file included from pg_prng.c:27: >> [21:23:10.814] ../../src/include/utils/float.h:46:16: error: ‘struct >> Node’ declared inside parameter list will not be visible outside of >> this definition or declaration [-Werror] >> [21:23:10.814] 46 | struct Node *escontext); > Hmm ... this looks an awful lot like it is the fault of ccff2d20e > not of the random_normal patch; that is, we probably need a > "struct Node" stub declaration in float.h. [ ... some head-scratching later ... ] No, we don't per our normal headerscheck rules, which are that headers such as utils/float.h need to be compilable after including just postgres.h. The "struct Node" stub declaration in elog.h will be visible, making the declaration of float8in_internal kosher. So the problem in this patch is that it's trying to include utils/float.h in a src/common file, where we have not included postgres.h. Question is, why did you do that? I see nothing in pg_prng_double_normal() that looks like it should require that header. If it did, it'd be questionable whether it's okay to be in src/common. regards, tom lane