From: Paul Eggert <eggert@cs.ucla.edu>
To: Florian Weimer <fw@deneb.enyo.de>
Cc: libc-alpha@sourceware.org
Subject: Re: [PATCH] assert: Support types without operator== (int) [BZ #21972]
Date: Fri, 18 Aug 2017 17:30:00 -0000 [thread overview]
Message-ID: <471d7561-65fd-966b-dd73-606baf83cab7@cs.ucla.edu> (raw)
In-Reply-To: <87o9rchkz5.fsf@mid.deneb.enyo.de>
Florian Weimer wrote:
>> Florian Weimer wrote:
>>> + ((void) sizeof (static_cast<bool> (expr)), __extension__ ({ \
>> Can we instead replace 'sizeof ((expr) == 0)' with 'sizeof !(expr)'?
>> That works in C, and if it also works in C++ it would avoid the need
>> for the #ifdef __cplusplus.
> It does not work in C++ because operator! could have been overloaded
> or deleted.
OK, then how about 'sizeof ((expr) ? 1 : 0)'? This should work because ?: cannot
be overloaded.
next prev parent reply other threads:[~2017-08-18 17:30 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-08-18 15:26 Florian Weimer
2017-08-18 15:34 ` Paul Eggert
2017-08-18 16:59 ` Florian Weimer
2017-08-18 17:30 ` Paul Eggert [this message]
2017-08-18 17:41 ` Florian Weimer
2017-08-18 18:28 ` Florian Weimer
2017-08-18 19:17 ` Paul Eggert
2017-08-18 19:57 ` Florian Weimer
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=471d7561-65fd-966b-dd73-606baf83cab7@cs.ucla.edu \
--to=eggert@cs.ucla.edu \
--cc=fw@deneb.enyo.de \
--cc=libc-alpha@sourceware.org \
/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).