]> git.ipfire.org Git - thirdparty/postgresql.git/commit
IWYU widely useful pragmas
authorPeter Eisentraut <peter@eisentraut.org>
Wed, 15 Jan 2025 17:57:53 +0000 (18:57 +0100)
committerPeter Eisentraut <peter@eisentraut.org>
Wed, 15 Jan 2025 17:57:53 +0000 (18:57 +0100)
commit74938d132093bc0ad99a5420da2e99edaa3734f9
tree91730468d8ce4968b2a6bfefed99ea17f82405fc
parent761c79508e7fbc33c1b11754bdde4bd03ce9cbb3
IWYU widely useful pragmas

Add various widely useful "IWYU pragma" annotations, such as

- Common header files such as c.h, postgres.h should be "always_keep".

- System headers included in c.h, postgres.h etc. should be considered
  "export".

- Some portability headers such as getopt_long.h should be
  "always_keep", so they are not considered superfluous on some
  platforms.

- Certain system headers included from portability headers should be
  considered "export" because the purpose of the portability header is
  to wrap them.

- Superfluous includes marked as "for backward compatibility" get a
  formal IWYU annotation.

- Generated header included in utils/syscache.h is marked exported.
  This is a very commonly used include and this avoids lots of
  complaints.

Discussion: https://www.postgresql.org/message-id/flat/9395d484-eff4-47c2-b276-8e228526c8ae@eisentraut.org
12 files changed:
src/include/c.h
src/include/getopt_long.h
src/include/pg_getopt.h
src/include/pg_trace.h
src/include/pgstat.h
src/include/port/pg_iovec.h
src/include/port/pg_pthread.h
src/include/postgres.h
src/include/postgres_ext.h
src/include/postgres_fe.h
src/include/utils/syscache.h
src/interfaces/libpq/libpq-int.h