Messages in this thread | | | From | Miguel Ojeda <> | Date | Fri, 15 Oct 2021 15:08:05 +0200 | Subject | Re: [PATCH] linux/container_of.h: switch to static_assert |
| |
On Fri, Oct 15, 2021 at 11:05 AM Rasmus Villemoes <linux@rasmusvillemoes.dk> wrote: > > _Static_assert() is evaluated already in the compiler's frontend, and > gives a somehat more to-the-point error, compared to the BUILD_BUG_ON > macro, which only fires after the optimizer has had a chance to > eliminate calls to functions marked with > __attribute__((error)). In theory, this might make builds a tiny bit > faster.
Thanks for this! Very much in favor!
Reviewed-by: Miguel Ojeda <ojeda@kernel.org>
Perhaps Andrew may want to add a link to the related discussion thread: https://lore.kernel.org/lkml/20211014132331.GA4811@kernel.org/T/
Cheers, Miguel
| |