mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Rasmus Villemoes <linux@rasmusvillemoes.dk>
To: Andrew Morton <akpm@linux-foundation.org>,
	Kees Cook <keescook@chromium.org>,
	Nick Desaulniers <ndesaulniers@google.com>,
	Masahiro Yamada <yamada.masahiro@socionext.com>,
	Luc Van Oostenryck <luc.vanoostenryck@gmail.com>,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH] build_bug.h: add wrapper for _Static_assert
Date: Tue, 5 Feb 2019 10:53:31 +0100	[thread overview]
Message-ID: <e819dbc8-5d7a-2f7b-35c5-e70754ba28e4@rasmusvillemoes.dk> (raw)
In-Reply-To: <20190204151209.d6fae2c6466cb5c9c5814fd9@linux-foundation.org>

On 05/02/2019 00.12, Andrew Morton wrote:
>>
>> It would be (very) nice to actually use this macro in a few places so
>> it gets its build testing while in -next.
> 
> ie, just about every BUILD_BUG_ON in mm/ could use this.  Let's switch
> a few?
> 

Perhaps, but some make sense where they are, e.g. when iterating over
two arrays using one iterator variable, it's fine to assert they have
the same size just above the loop. And, unfortunately, static_assert()
is not quite a drop-in replacement for BUILD_BUG_ON even when the
argument is an ICE due to -Wdeclaration-after-statement.

I'll fix the two BUILD_BUGs I know I've added over the years (one in
vsprintf.c, one in fs/namei.c).

Rasmus

  reply	other threads:[~2019-02-05  9:53 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-02-03 19:24 Rasmus Villemoes
2019-02-04 23:09 ` Andrew Morton
2019-02-04 23:12   ` Andrew Morton
2019-02-05  9:53     ` Rasmus Villemoes [this message]
2019-02-05 20:27       ` Luc Van Oostenryck
2019-02-05  8:05 ` Masahiro Yamada
2019-02-05  9:38   ` Rasmus Villemoes
2019-02-05 14:06     ` Masahiro Yamada
2019-02-07  0:14     ` Nick Desaulniers
2019-02-08 20:30 ` [PATCH v2 1/3] " Rasmus Villemoes
2019-02-08 20:30   ` [PATCH v2 2/3] lib/vsprintf.c: move sizeof(struct printf_spec) next to its definition Rasmus Villemoes
2019-02-08 20:30   ` [PATCH v2 3/3] linux/fs.h: move member alignment check next to definition of struct filename Rasmus Villemoes

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=e819dbc8-5d7a-2f7b-35c5-e70754ba28e4@rasmusvillemoes.dk \
    --to=linux@rasmusvillemoes.dk \
    --cc=akpm@linux-foundation.org \
    --cc=keescook@chromium.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=luc.vanoostenryck@gmail.com \
    --cc=ndesaulniers@google.com \
    --cc=yamada.masahiro@socionext.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®