From: peter0x44 <peter0x44@disroot.org>
To: Joseph Myers <joseph@codesourcery.com>
Cc: Gcc <gcc@gcc.gnu.org>
Subject: Re: Suboptimal warning formatting with `bool` type in C
Date: Wed, 01 Nov 2023 23:28:14 +0000 [thread overview]
Message-ID: <288ea19452236f82f8f145f9b15e6335@disroot.org> (raw)
In-Reply-To: <586ce4ef-2760-3f79-627e-ca34e345319d@codesourcery.com>
[-- Attachment #1: Type: text/plain, Size: 748 bytes --]
On 2023-11-01 23:13, Joseph Myers wrote:
> On Wed, 1 Nov 2023, peter0x44 via Gcc wrote:
>
>> Why is #define used instead of typedef? I can't imagine how this could
>> possibly break any existing code.
>
> That's how stdbool.h is specified up to C17. In C23, bool is a keyword
> instead.
I see, I didn't know it was specified that way. It seems quite strange
that typedef wouldn't be used for this purpose.
I suppose perhaps it matters if you #undef bool and then use it to
define your own type? Still, it seems very strange to do this.
Maybe it's something to offer as a GNU extension? Though, I'm leaning
towards too trivial to be worth it, just for a (very minor) improvement
to a diagnostic that can probably be handled in other ways.
next prev parent reply other threads:[~2023-11-01 23:28 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-11-01 23:10 peter0x44
2023-11-01 23:13 ` Joseph Myers
2023-11-01 23:28 ` peter0x44 [this message]
2023-11-02 9:24 ` David Brown
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=288ea19452236f82f8f145f9b15e6335@disroot.org \
--to=peter0x44@disroot.org \
--cc=gcc@gcc.gnu.org \
--cc=joseph@codesourcery.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;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).