[lkml]   [2019]   [Mar]   [10]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
Messages in this thread
SubjectRe: [PATCH] static_assert: move before people start using it
On Sun, Mar 10, 2019 at 10:19:37PM +0100, Rasmus Villemoes wrote:
> On 10/03/2019 11.51, Alexey Dobriyan wrote:
> > Userspace places static_assert() macro at <assert.h>
> >
> So? That seems a rather weak argument. We have lots of interfaces that
> also exist in userspace which are not declared in similar-named headers
> (e.g. we have no stdio.h, which is where snprintf lives). Not to mention
> that memcpy and friends are in <linux/string.h>, not a bare <string.h>.

Linux 0.01 had memcpy() in <string.h> in fact. :^)
I don't know what happened.

> Your assert.h would be the first and only header to live directly in
> include/.
> If you can somehow convince Andrew to take it you can add a Meh'ed-by me.

The whole BUILD_BUG() thing is a misnomer. Userspace has assert() forever
and it doesn't require double negating (which is why assert is good
and BUILD_BUG is bad). Once everything is converted to static_assert(),
it will live in build_bug.h, so might as well put it into right place

 \ /
  Last update: 2019-03-10 22:30    [W:0.050 / U:0.628 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site