IWYU widely useful pragmas
Peter Eisentraut <peter@eisentraut.org>
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
Files
| Path | Change | +/− |
|---|---|---|
| src/include/c.h | modified | +5 −0 |
| src/include/getopt_long.h | modified | +2 −1 |
| src/include/pg_getopt.h | modified | +3 −2 |
| src/include/pgstat.h | modified | +3 −3 |
| src/include/pg_trace.h | modified | +1 −1 |
| src/include/port/pg_iovec.h | modified | +1 −1 |
| src/include/port/pg_pthread.h | modified | +1 −1 |
| src/include/postgres_ext.h | modified | +1 −0 |
| src/include/postgres_fe.h | modified | +5 −0 |
| src/include/postgres.h | modified | +5 −0 |
| src/include/utils/syscache.h | modified | +1 −1 |
| src/interfaces/libpq/libpq-int.h | modified | +2 −0 |
Discussion
- IWYU annotations 9 messages · 2024-12-09 → 2025-01-22