linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Miguel Ojeda <miguel.ojeda.sandonis@gmail.com>
To: Rasmus Villemoes <linux@rasmusvillemoes.dk>
Cc: Nick Desaulniers <ndesaulniers@google.com>,
	Peter Zijlstra <peterz@infradead.org>,
	Miguel Ojeda <ojeda@kernel.org>,
	Nathan Chancellor <nathan@kernel.org>,
	Kees Cook <keescook@chromium.org>,
	linux-kernel <linux-kernel@vger.kernel.org>,
	llvm@lists.linux.dev,
	Linus Torvalds <torvalds@linux-foundation.org>
Subject: Re: [PATCH] compiler_types: mark __compiletime_assert failure as __noreturn
Date: Fri, 15 Oct 2021 14:36:56 +0200	[thread overview]
Message-ID: <CANiq72ne8m4q1rRToJsH1A+b1_7FAk1wYtcwvKc9zH_8sR2-gQ@mail.gmail.com> (raw)
In-Reply-To: <d1c957c4-a2df-935c-2992-3540f05fb110@rasmusvillemoes.dk>

On Fri, Oct 15, 2021 at 10:11 AM Rasmus Villemoes
<linux@rasmusvillemoes.dk> wrote:
>
> A yakshave that would be worthwhile is to kill off the macro
> compiletime_assert() completely - three is a crowd. It sounds like it
> would be implemented in terms of _Static_assert, but it's actually
> __attribute__(error). We can fold the definition of compiletime_assert
> into BUILD_BUG_ON_MSG.

Agreed, two should be enough.

> Why do we even have a no-op version if !__OPTIMIZE__? AFAIK there's no
> CONFIG_O0 option, and such a build wouldn't be interesting at all - it
> can't be expected to boot, and it would likely throw warnings left and
> right.

Yeah, I don't think it would compile as it is anyway.

Perhaps it is there for some kind of tooling? For a static analyzer or
something like sparse (if it didn't have its own define)...

But yeah, every use of it should have a comment explaining why it is
there, like crypto/jitterentropy.c does. There are a couple without
it.

Cheers,
Miguel

  reply	other threads:[~2021-10-15 12:37 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-10-14 13:23 [PATCH] compiler_types: mark __compiletime_assert failure as __noreturn Miguel Ojeda
2021-10-14 15:01 ` Peter Zijlstra
2021-10-14 17:48   ` Nick Desaulniers
2021-10-14 18:33     ` Miguel Ojeda
2021-10-14 18:41       ` Miguel Ojeda
2021-10-14 18:55         ` Nick Desaulniers
2021-10-14 19:33           ` Miguel Ojeda
2021-10-15  7:55           ` Rasmus Villemoes
2021-10-15  8:11     ` Rasmus Villemoes
2021-10-15 12:36       ` Miguel Ojeda [this message]
2021-10-14 17:26 ` Nathan Chancellor
2021-10-14 17:36 ` Nick Desaulniers
2021-10-21 23:20 ` Miguel Ojeda
2021-12-02  6:12 ` Dan Carpenter
2021-12-02  6:24   ` Dan Carpenter

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=CANiq72ne8m4q1rRToJsH1A+b1_7FAk1wYtcwvKc9zH_8sR2-gQ@mail.gmail.com \
    --to=miguel.ojeda.sandonis@gmail.com \
    --cc=keescook@chromium.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux@rasmusvillemoes.dk \
    --cc=llvm@lists.linux.dev \
    --cc=nathan@kernel.org \
    --cc=ndesaulniers@google.com \
    --cc=ojeda@kernel.org \
    --cc=peterz@infradead.org \
    --cc=torvalds@linux-foundation.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 NNTP newsgroup(s).