Re: backend *.c #include cleanup (IWYU)
Peter Eisentraut <peter@eisentraut.org>
From: Peter Eisentraut <peter@eisentraut.org>
To: pgsql-hackers <pgsql-hackers@postgresql.org>
Cc: Andres Freund <andres@anarazel.de>
Date: 2024-02-26T08:30:37Z
Lists: pgsql-hackers
Attachments
- v3-0001-Remove-unused-include-s-from-backend-.c-files.patch (text/plain) patch v3-0001
On 19.02.24 08:59, Peter Eisentraut wrote: >> There are other changes I don't understand. E.g. why is >> catalog/binary_upgrade.h removed from pg_enum.c? It's actually defining >> binary_upgrade_next_pg_enum_oid, declared in catalog/binary_upgrade.h? > > Ah, this is a deficiency in IWYU. It keeps headers that provide > function prototypes, but it doesn't keep headers that provide extern > declarations of global variables. I have filed an issue about that, and > it looks like a fix might already be on the way.[0] > > [0]: > https://github.com/include-what-you-use/include-what-you-use/issues/1461 > > This issue also led me to discover -Wmissing-variable-declarations, > about which I will post separately. > > In the meantime, here is an updated patch with rebase and the above > issues fixed. Here is another rebase. Also, for extra caution, I undid all the removals of various port(ability) includes, such as "port/atomics.h", just in case they happen to have some impact in some obscure configuration (= not covered by Cirrus CI). I propose to commit this patch now, and then maybe come back with more IWYU-related proposals in the future once the above issues are fixed.
Commits
-
Remove unused #include's from backend .c files
- dbbca2cf299b 17.0 landed