From: Misbah Anjum N <misanjum@linux.ibm.com>
To: linuxppc-dev@lists.ozlabs.org
Cc: maddy@linux.ibm.com, mpe@ellerman.id.au, npiggin@gmail.com,
christophe.leroy@csgroup.eu, naveen@kernel.org,
linux-kernel@vger.kernel.org
Subject: [PATCH 1/1] arch/powerpc: Remove redundant typedef for bool
Date: Sun, 23 Mar 2025 11:36:07 -0500 [thread overview]
Message-ID: <20250323163607.537270-2-misanjum@linux.ibm.com> (raw)
In-Reply-To: <20250323163607.537270-1-misanjum@linux.ibm.com>
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@linux.ibm.com>
---
arch/powerpc/boot/types.h | 2 ++
1 file changed, 2 insertions(+)
diff --git a/arch/powerpc/boot/types.h b/arch/powerpc/boot/types.h
index 8a4c418b7..6f34b31b8 100644
--- a/arch/powerpc/boot/types.h
+++ b/arch/powerpc/boot/types.h
@@ -40,7 +40,9 @@ 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))
+#if !defined(__STDC_VERSION__) || __STDC_VERSION__ < 202300L
typedef int bool;
+#endif
#ifndef true
#define true 1
--
2.49.0
next prev parent reply other threads:[~2025-03-23 16:36 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-03-23 16:36 Misbah Anjum N
2025-03-23 16:36 ` Misbah Anjum N [this message]
2025-04-17 6:09 ` Mukesh Kumar Chaurasiya
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20250323163607.537270-2-misanjum@linux.ibm.com \
--to=misanjum@linux.ibm.com \
--cc=christophe.leroy@csgroup.eu \
--cc=linux-kernel@vger.kernel.org \
--cc=linuxppc-dev@lists.ozlabs.org \
--cc=maddy@linux.ibm.com \
--cc=mpe@ellerman.id.au \
--cc=naveen@kernel.org \
--cc=npiggin@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®