diff mbox series

gcc-plugins: Remove duplicate included header file stringpool.h

Message ID 20240629233608.278028-2-thorsten.blum@toblux.com (mailing list archive)
State Mainlined
Commit 18c18b1ff6c648ea62571554dfd698110757f894
Headers show
Series gcc-plugins: Remove duplicate included header file stringpool.h | expand

Commit Message

Thorsten Blum June 29, 2024, 11:36 p.m. UTC
The header file stringpool.h is included for GCC version >= 8 and then
again for all versions.

Since the header file stringpool.h was added in GCC 4.9 and the kernel
currently requires GCC 5.1 as a minimum, remove the conditional include.

Including the header file only once removes the following warning
reported by make includecheck:

  stringpool.h is included more than once

However, it's important to include stringpool.h before attribs.h
because attribs.h uses some of its functions.

Compile-tested with GCC 14.

Signed-off-by: Thorsten Blum <thorsten.blum@toblux.com>
---
 scripts/gcc-plugins/gcc-common.h | 5 -----
 1 file changed, 5 deletions(-)

Comments

Kees Cook July 2, 2024, 9:17 p.m. UTC | #1
On Sun, 30 Jun 2024 01:36:09 +0200, Thorsten Blum wrote:
> The header file stringpool.h is included for GCC version >= 8 and then
> again for all versions.
> 
> Since the header file stringpool.h was added in GCC 4.9 and the kernel
> currently requires GCC 5.1 as a minimum, remove the conditional include.
> 
> Including the header file only once removes the following warning
> reported by make includecheck:
> 
> [...]

Applied to for-next/hardening, thanks!

[1/1] gcc-plugins: Remove duplicate included header file stringpool.h
      https://git.kernel.org/kees/c/3a8ccb6a6829

Take care,
diff mbox series

Patch

diff --git a/scripts/gcc-plugins/gcc-common.h b/scripts/gcc-plugins/gcc-common.h
index 1ae39b9f4a95..3222c1070444 100644
--- a/scripts/gcc-plugins/gcc-common.h
+++ b/scripts/gcc-plugins/gcc-common.h
@@ -62,11 +62,7 @@ 
 #include "pass_manager.h"
 #include "predict.h"
 #include "ipa-utils.h"
-
-#if BUILDING_GCC_VERSION >= 8000
 #include "stringpool.h"
-#endif
-
 #include "attribs.h"
 #include "varasm.h"
 #include "stor-layout.h"
@@ -78,7 +74,6 @@ 
 #include "context.h"
 #include "tree-ssa-alias.h"
 #include "tree-ssa.h"
-#include "stringpool.h"
 #if BUILDING_GCC_VERSION >= 7000
 #include "tree-vrp.h"
 #endif