mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
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:06 -0500	[thread overview]
Message-ID: <20250323163607.537270-1-misanjum@linux.ibm.com> (raw)

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(+)

-- 
2.49.0


             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 [this message]
2025-03-23 16:36 ` Misbah Anjum N
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-1-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®