diff options
| author | Peter Eisentraut | 2025-01-15 17:57:53 +0000 |
|---|---|---|
| committer | Peter Eisentraut | 2025-01-15 17:57:53 +0000 |
| commit | 74938d132093bc0ad99a5420da2e99edaa3734f9 (patch) | |
| tree | 91730468d8ce4968b2a6bfefed99ea17f82405fc /src/include/c.h | |
| parent | 761c79508e7fbc33c1b11754bdde4bd03ce9cbb3 (diff) | |
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
Diffstat (limited to 'src/include/c.h')
| -rw-r--r-- | src/include/c.h | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/src/include/c.h b/src/include/c.h index ab6a49aeca4..a14c6315162 100644 --- a/src/include/c.h +++ b/src/include/c.h @@ -16,6 +16,7 @@ * *------------------------------------------------------------------------- */ +/* IWYU pragma: always_keep */ /* *---------------------------------------------------------------- * TABLE OF CONTENTS @@ -46,6 +47,8 @@ #ifndef C_H #define C_H +/* IWYU pragma: begin_exports */ + /* * These headers must be included before any system headers, because on some * platforms they affect the behavior of the system headers (for example, by @@ -1327,4 +1330,6 @@ typedef intptr_t sigjmp_buf[5]; /* /port compatibility functions */ #include "port.h" +/* IWYU pragma: end_exports */ + #endif /* C_H */ |
