[<prev] [next>] [day] [month] [year] [list]
Message-ID: <20250322211104.231795-1-misanjum@linux.ibm.com>
Date: Sat, 22 Mar 2025 16:11:04 -0500
From: Misbah Anjum N <misanjum@...ux.ibm.com>
To: linuxppc-dev@...ts.ozlabs.org
Cc: maddy@...ux.ibm.com, mpe@...erman.id.au, npiggin@...il.com,
christophe.leroy@...roup.eu, naveen@...nel.org,
linux-kernel@...r.kernel.org
Subject: [RFC PATCH] arch/powerpc: Remove redundant typedef for bool
The custom 'bool' typedef in arch/powerpc/boot/types.h is incompatible with
the C23 standard, where 'bool', 'true', and 'false' are now reserved keywords.
With newer GCC versions (such as GCC 15), redefining 'bool' leads to compilation
errors. For example:
error: 'bool' cannot be defined via 'typedef'
Since 'stdbool.h' is already included and provides a standard definition for
'bool', this typedef is redundant and can be removed to avoid conflicts.
Compilation Error:
$ make -j$(nproc)
....
In file included from arch/powerpc/boot/ops.h:13,
from arch/powerpc/boot/cuboot.c:12:
arch/powerpc/boot/types.h:43:13: error: ‘bool’ cannot be defined via ‘typedef’
43 | typedef int bool;
| ^~~~
arch/powerpc/boot/types.h:43:13: note: ‘bool’ is a keyword with ‘-std=c23’ onwards
arch/powerpc/boot/types.h:43:1: warning: useless type name in empty declaration
43 | typedef int bool;
| ^~~~~~~
....
make[2]: *** [arch/powerpc/boot/Makefile:235: arch/powerpc/boot/devtree.o] Error 1
make[2]: *** [arch/powerpc/boot/Makefile:235: arch/powerpc/boot/ofconsole.o] Error 1
make[2]: *** [arch/powerpc/boot/Makefile:235: arch/powerpc/boot/ns16550.o] Error 1
make[2]: *** [arch/powerpc/boot/Makefile:235: arch/powerpc/boot/main.o] Error 1
make[1]: *** [arch/powerpc/Makefile:236: zImage] Error 2
make: *** [Makefile:251: __sub-make] Error 2
Signed-off-by: Misbah Anjum N <misanjum@...ux.ibm.com>
---
arch/powerpc/boot/types.h | 2 --
1 file changed, 2 deletions(-)
diff --git a/arch/powerpc/boot/types.h b/arch/powerpc/boot/types.h
index 8a4c418b7..abae1e93a 100644
--- a/arch/powerpc/boot/types.h
+++ b/arch/powerpc/boot/types.h
@@ -40,8 +40,6 @@ typedef s64 int64_t;
#define min_t(type, a, b) min(((type) a), ((type) b))
#define max_t(type, a, b) max(((type) a), ((type) b))
-typedef int bool;
-
#ifndef true
#define true 1
#endif
--
2.49.0
Powered by blists - more mailing lists