summaryrefslogtreecommitdiff
path: root/src/include/pg_getopt.h
diff options
context:
space:
mode:
authorPeter Eisentraut2025-01-15 17:57:53 +0000
committerPeter Eisentraut2025-01-15 17:57:53 +0000
commit74938d132093bc0ad99a5420da2e99edaa3734f9 (patch)
tree91730468d8ce4968b2a6bfefed99ea17f82405fc /src/include/pg_getopt.h
parent761c79508e7fbc33c1b11754bdde4bd03ce9cbb3 (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/[email protected]
Diffstat (limited to 'src/include/pg_getopt.h')
-rw-r--r--src/include/pg_getopt.h5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/include/pg_getopt.h b/src/include/pg_getopt.h
index 2e2d64f4a26..aad0886c054 100644
--- a/src/include/pg_getopt.h
+++ b/src/include/pg_getopt.h
@@ -15,15 +15,16 @@
*
* src/include/pg_getopt.h
*/
+/* IWYU pragma: always_keep */
#ifndef PG_GETOPT_H
#define PG_GETOPT_H
/* POSIX says getopt() is provided by unistd.h */
-#include <unistd.h>
+#include <unistd.h> /* IWYU pragma: export */
/* rely on the system's getopt.h if present */
#ifdef HAVE_GETOPT_H
-#include <getopt.h>
+#include <getopt.h> /* IWYU pragma: export */
#endif
/*