From: Rasmus Villemoes <linux@rasmusvillemoes.dk>
To: Vincent Mailhol <mailhol.vincent@wanadoo.fr>
Cc: Linus Torvalds <torvalds@linux-foundation.org>,
Yury Norov <yury.norov@gmail.com>,
Luc Van Oostenryck <luc.vanoostenryck@gmail.com>,
linux-kernel@vger.kernel.org, linux-sparse@vger.kernel.org,
Rikard Falkeborn <rikard.falkeborn@gmail.com>
Subject: Re: [RESEND PATCH v3 1/2] compiler.h: add _static_assert()
Date: Tue, 12 Nov 2024 21:03:44 +0100 [thread overview]
Message-ID: <8734jwnrrz.fsf@prevas.dk> (raw)
In-Reply-To: <20241112190840.601378-5-mailhol.vincent@wanadoo.fr> (Vincent Mailhol's message of "Wed, 13 Nov 2024 04:08:39 +0900")
On Wed, Nov 13 2024, Vincent Mailhol <mailhol.vincent@wanadoo.fr> wrote:
>
> Declare a new _statically_true() macro which, by making use of the
> __builtin_choose_expr() and __is_constexpr(x) combo, always produces a
> constant expression.
Looks sane, but $subject needs s/_static_assert/_statically_true/. And
to be completely pedantic, macros are defined, not declared.
>
> - above examples, and a bit more:
>
> https://godbolt.org/z/zzqM1ajPj
>
> - a proof that statically_true() does better constant folding than _statically_true()
>
> https://godbolt.org/z/vK6KK4hMG
At least the second of these might be good to refer to in the commit
message itself.
Rasmus
next prev parent reply other threads:[~2024-11-12 20:03 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-11-12 19:08 [RESEND PATCH v3 0/2] add _statically_true() to simplify GENMASK_INPUT_CHECK() Vincent Mailhol
2024-11-12 19:08 ` [RESEND PATCH v3 1/2] compiler.h: add _static_assert() Vincent Mailhol
2024-11-12 20:03 ` Rasmus Villemoes [this message]
2024-11-13 17:47 ` Vincent Mailhol
2024-11-12 20:26 ` Yury Norov
2024-11-13 17:44 ` Vincent Mailhol
2024-11-12 19:08 ` [RESEND PATCH v3 2/2] linux/bits.h: simplify GENMASK_INPUT_CHECK() Vincent Mailhol
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=8734jwnrrz.fsf@prevas.dk \
--to=linux@rasmusvillemoes.dk \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-sparse@vger.kernel.org \
--cc=luc.vanoostenryck@gmail.com \
--cc=mailhol.vincent@wanadoo.fr \
--cc=rikard.falkeborn@gmail.com \
--cc=torvalds@linux-foundation.org \
--cc=yury.norov@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;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).