[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH 5/7] Omit some redundant include directives
From: |
Paul Eggert |
Subject: |
[PATCH 5/7] Omit some redundant include directives |
Date: |
Thu, 26 Jan 2023 14:17:36 -0800 |
Do not include <config.h> at the start of .h files, since the
including .c file is supposed to include <config.h> first anyway,
and putting the "#include <config.h>" in a .h file provides
only a false sense of security. The unnecessary practice of
multiple includes is brittle and caused problems with building
GNU poke 2.90.1 on CLFS for LoongArch64 7.2 with
13.0.0 20221018 (experimental) as described in
https://lists.gnu.org/r/bug-gnulib/2023-01/msg00207.html
Also, do not have jitterc-rewrite.h include itself, as that's
merely a confusing no-op.
---
example-vms/jitterlisp/jitterlisp-operations.h | 3 ---
example-vms/jitterlisp/jitterlisp-run-input.h | 3 ---
example-vms/jitterlisp/jitterlisp.h | 3 ---
jitterc/jitterc-generate.h | 3 ---
jitterc/jitterc-rewrite.h | 4 ----
jitterc/jitterc-utility.h | 2 --
jitterc/jitterc-vm.h | 3 ---
7 files changed, 21 deletions(-)
diff --git a/example-vms/jitterlisp/jitterlisp-operations.h
b/example-vms/jitterlisp/jitterlisp-operations.h
index 1ad93d2..ac4f4ad 100644
--- a/example-vms/jitterlisp/jitterlisp-operations.h
+++ b/example-vms/jitterlisp/jitterlisp-operations.h
@@ -23,9 +23,6 @@
#ifndef JITTERLISP_OPERATIONS_H_
#define JITTERLISP_OPERATIONS_H_
-/* Include the Gnulib header. */
-#include <config.h>
-
#include <stdbool.h>
#include "jitterlisp-sexpression.h"
diff --git a/example-vms/jitterlisp/jitterlisp-run-input.h
b/example-vms/jitterlisp/jitterlisp-run-input.h
index 22f43f4..ead79e9 100644
--- a/example-vms/jitterlisp/jitterlisp-run-input.h
+++ b/example-vms/jitterlisp/jitterlisp-run-input.h
@@ -23,9 +23,6 @@
#ifndef JITTERLISP_RUN_INPUT_H_
#define JITTERLISP_RUN_INPUT_H_
-/* JitterLisp does rely on Gnulib for portability. */
-#include <config.h>
-
#include <stdio.h>
#include "jitterlisp.h"
diff --git a/example-vms/jitterlisp/jitterlisp.h
b/example-vms/jitterlisp/jitterlisp.h
index 138eff3..2943ce6 100644
--- a/example-vms/jitterlisp/jitterlisp.h
+++ b/example-vms/jitterlisp/jitterlisp.h
@@ -28,9 +28,6 @@
/* Header transitive inclusion.
* **************************************************************************
*/
-/* JitterLisp does rely on Gnulib for portability. */
-#include <config.h>
-
/* Include the other JitterLisp headers, so that the user has to deal with this
one only. */
#include "jitterlisp-config.h"
diff --git a/jitterc/jitterc-generate.h b/jitterc/jitterc-generate.h
index 071b283..40a1169 100644
--- a/jitterc/jitterc-generate.h
+++ b/jitterc/jitterc-generate.h
@@ -23,9 +23,6 @@
#ifndef JITTERC_JITTERC_GENERATE_H_
#define JITTERC_JITTERC_GENERATE_H_
-/* Include the Gnulib header. */
-#include <config.h>
-
#include <stdbool.h>
#include <gl_list.h>
diff --git a/jitterc/jitterc-rewrite.h b/jitterc/jitterc-rewrite.h
index a4bb474..9fa2dab 100644
--- a/jitterc/jitterc-rewrite.h
+++ b/jitterc/jitterc-rewrite.h
@@ -22,16 +22,12 @@
#ifndef JITTERC_REWRITE_H_
#define JITTERC_REWRITE_H_
-/* Include Gnulib functions. */
-#include <config.h>
-
/* Include standard headers. */
#include <stdlib.h>
#include <stdbool.h>
/* Include the Jitter main header, and generation-time headers. */
#include <jitter/jitter.h>
-#include "jitterc-rewrite.h"
#include "jitterc-vm.h"
diff --git a/jitterc/jitterc-utility.h b/jitterc/jitterc-utility.h
index b1a463b..0d36023 100644
--- a/jitterc/jitterc-utility.h
+++ b/jitterc/jitterc-utility.h
@@ -23,8 +23,6 @@
#ifndef JITTERC_UTILITY_H_
#define JITTERC_UTILITY_H_
-/* Include the Gnulib header. */
-#include <config.h>
#include <gl_list.h>
diff --git a/jitterc/jitterc-vm.h b/jitterc/jitterc-vm.h
index 4af9644..dcd7bb4 100644
--- a/jitterc/jitterc-vm.h
+++ b/jitterc/jitterc-vm.h
@@ -22,9 +22,6 @@
#ifndef JITTERC_JITTERC_VM_H_
#define JITTERC_JITTERC_VM_H_
-/* Include the Gnulib header. */
-#include <config.h>
-
#include <stdlib.h>
#include <stdbool.h>
--
2.39.1
- [PATCH 0/7] improve porting and Gnulib integration, Paul Eggert, 2023/01/26
- [PATCH 2/7] Update bootstrap from Gnulib, Paul Eggert, 2023/01/26
- [PATCH 5/7] Omit some redundant include directives,
Paul Eggert <=
- [PATCH 3/7] Update LDADD for recent Gnulib, Paul Eggert, 2023/01/26
- [PATCH 7/7] Remove unused attribute macro, Paul Eggert, 2023/01/26
- [PATCH 1/7] Port bootstrap.conf BREs to POSIX, Paul Eggert, 2023/01/26
- [PATCH 6/7] Simplify __attribute__ tests, less porting hassle, Paul Eggert, 2023/01/26
- [PATCH 4/7] Don’t assume compilers don’t output to stderr, Paul Eggert, 2023/01/26