From: Tom Lane <tgl@sss.pgh.pa.us>
To: Paul Ramsey <pramsey@cleverelephant.ca>
Cc: Michael Paquier <michael@paquier.xyz>
Cc: Justin Pryzby <pryzby@telsasoft.com>
Cc: pgsql-hackers@postgresql.org
Subject: Re: [PATCH] random_normal function
Date: Tue, 03 Jan 2023 11:41:37 -0500
Message-ID: <1776287.1672764097@sss.pgh.pa.us> (raw)
In-Reply-To: <1682143.1672713508@sss.pgh.pa.us>
References: <CACowWR0DqHAvOKUCNxTrASFkWsDLqKMd6WiXvVvaWg4pV1BMnQ@mail.gmail.com>
<20221208224623.GQ27893@telsasoft.com>
<F103485B-F7B3-40CF-A149-17BA70AF2B61@cleverelephant.ca>
<20221231035804.GJ1153@telsasoft.com>
<Y7OR5nh8qetbwgXX@paquier.xyz>
<1682143.1672713508@sss.pgh.pa.us>
I wrote:
> Michael Paquier <michael@paquier.xyz> 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
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients from your mail client; the link fills in
the headers below: reply via email
Some clients, webmail especially, drop In-Reply-To and References from
a link, and the reply then starts a new thread: use the mbox below.
To: pgsql-hackers@postgresql.org
Cc: tgl@sss.pgh.pa.us, pramsey@cleverelephant.ca, michael@paquier.xyz, pryzby@telsasoft.com
Subject: Re: [PATCH] random_normal function
In-Reply-To: <1776287.1672764097@sss.pgh.pa.us>
References: <CACowWR0DqHAvOKUCNxTrASFkWsDLqKMd6WiXvVvaWg4pV1BMnQ@mail.gmail.com> <20221208224623.GQ27893@telsasoft.com> <F103485B-F7B3-40CF-A149-17BA70AF2B61@cleverelephant.ca> <20221231035804.GJ1153@telsasoft.com> <Y7OR5nh8qetbwgXX@paquier.xyz> <1682143.1672713508@sss.pgh.pa.us> <1776287.1672764097@sss.pgh.pa.us>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox