Re: IWYU annotations

From: Peter Eisentraut <peter(at)eisentraut(dot)org>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: pgsql-hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: IWYU annotations
Date: 2025-01-10 08:10:06
Message-ID: 51408c8e-9f23-4b28-bbd6-7481bb57203a@eisentraut.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On 02.01.25 17:15, Tom Lane wrote:
>> It's a fair point that some documentation could be provided. I suppose
>> we don't want to verbosely explain each pragma individually. Should
>> there be some central explanation, maybe in src/tools/pginclude/README?
>
> That might do, but perhaps instead in the "PostgreSQL Coding
> Conventions" chapter of the SGML docs? Actually, I think we could do
> with a centralized explanation of our inclusion conventions --- I'm
> not sure that the whole business of "postgres.h or a sibling must be
> first" is explained in any easy-to-find place. This topic would
> likely fit well with such an explanation.

In this updated patch set, I've just added a bit of info into
src/tools/pginclude/README. Updating the coding convention
documentation like you suggest also sounds like a good idea, but from my
perspective I would need to do further research to pin down what those
actually are, so I'm leaving that as a separate project.

(See for example the business in src/tools/pginclude/headerscheck about
guessing which the appropriate first header file should be for each
component. That kind of thing perhaps ought to be more formalized.)

> But really, the point I was trying to make above is that I don't
> want this to break our very long-standing convention that headers
> should be #include'd alphabetically and there is never a need to
> impose some other order (at least not without lots of commentary
> about it at the scene of the crime). The way you've done it here
> is just asking for trouble, IMO. If that means redundant pragma
> commands, so be it.

Yeah, that's a fair point. I have removed that part from my patch set.

Attachment Content-Type Size
v2-0001-IWYU-widely-useful-pragmas.patch text/plain 7.7 KB
v2-0002-IWYU-pragmas-for-catalog-headers.patch text/plain 32.1 KB
v2-0003-Add-a-bit-of-documentation-related-to-IWYU.patch text/plain 2.4 KB

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Bertrand Drouvot 2025-01-10 08:23:46 Re: Make pg_stat_io view count IOs as bytes instead of blocks
Previous Message Hunaid Sohail 2025-01-10 07:47:35 Re: Psql meta-command conninfo+