[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <jwhxcpjsikjfwmeibpssbc3mvr7dhkd225bfgp4pukr3caugxd@mdruiivxfhod>
Date: Thu, 17 Apr 2025 11:39:20 +0530
From: Mukesh Kumar Chaurasiya <mchauras@...ux.ibm.com>
To: Misbah Anjum N <misanjum@...ux.ibm.com>
Cc: linuxppc-dev@...ts.ozlabs.org, maddy@...ux.ibm.com, mpe@...erman.id.au,
npiggin@...il.com, christophe.leroy@...roup.eu, naveen@...nel.org,
linux-kernel@...r.kernel.org
Subject: Re: [PATCH 1/1] arch/powerpc: Remove redundant typedef for bool
On Sun, Mar 23, 2025 at 11:36:06AM -0500, Misbah Anjum N wrote:
> Hi,
>
> I noticed that a patch addressing the same issue has been proposed by
> Michal Suchanek:
> https://lore.kernel.org/linuxppc-dev/Z86liwlwP5WvrEkw@kitsune.suse.cz/T/#t
>
> The existing patch addresses the compilation error by modifying the Makefile
> to use `gnu11` with `BOOTTARGETFLAGS`. This is a practical approach to avoid
> the error in the short term.
>
> This patch builds on that work by providing a long-term solution that ensures
> compatibility with C23 while maintaining backward compatibility. Specifically:
> - It uses `__STDC_VERSION__` to conditionally define the `bool` typedef only
> for pre-C23 standards.
> - It ensures that the code is future-proof and ready for upcoming C23 standards,
> where `bool`, `true`, and `false` are reserved keywords.
> - It avoids reliance on compiler-specific flags, making the code more portable
> and standards-compliant.
>
> Changlog:
> - Adding version check via __STDC_VERSION__
> - If __STDC_VERSION__ < C23, 'typedef int bool' is defined as usual
> - If __STDC_VERSION__ >= C23, the typedef redundancy is removed
>
> The patch has been tested with:
> - gcc (GCC) 15.0.1 20250228 (Red Hat 15.0.1-0)
> - gcc (GCC) 14.2.1 20250110 (Red Hat 14.2.1-7)
>
> Thanks,
> Misbah Anjum N
>
>
> Misbah Anjum N (1):
> arch/powerpc: Remove redundant typedef for bool
>
> arch/powerpc/boot/types.h | 2 ++
> 1 file changed, 2 insertions(+)
>
Reviewed-by: Mukesh Kumar Chaurasiya <mchauras@...ux.ibm.com>
> --
> 2.49.0
>
Powered by blists - more mailing lists