Messages in this thread | | | Date | Tue, 28 Mar 2023 09:47:09 -0400 | From | Steven Rostedt <> | Subject | Re: union: was: Re: [PATCH printk v1 05/18] printk: Add non-BKL console basic infrastructure |
| |
On Tue, 28 Mar 2023 11:48:06 +0206 John Ogness <john.ogness@linutronix.de> wrote:
> > static_assert(sizeof(struct cons_state) == sizeof(atomic_long_t)); > > I never realized the kernel code was allowed to have that. But it is > everywhere! :-) Thanks. I've added and tested the following:
I didn't know about static_assert(), as I always used BUILD_BUG_ON().
The difference being that BUILD_BUG_ON() has to be used within a function, where as static_assert() can be done outside of functions. Hmm, maybe I can convert some of my BUILD_BUG_ON()s to static_assert()s.
Learn something new every day.
-- Steve
| |