Re: Compile time assert macro

2013-05-17 Thread Mark Kettenis
> Date: Fri, 17 May 2013 13:24:45 +0200 (CEST) > From: Stefan Fritsch > > On Fri, 3 May 2013, Stefan Fritsch wrote: > > I think a CTASSERT macro like in FreeBSD would be nice. It could be used > > to verify assumptions about type and struct sizes. > > Ariane suggested making the syntax compatib

Re: Compile time assert macro

2013-05-17 Thread Stefan Fritsch
On Fri, 3 May 2013, Stefan Fritsch wrote: > I think a CTASSERT macro like in FreeBSD would be nice. It could be used > to verify assumptions about type and struct sizes. Ariane suggested making the syntax compatible to the C11 variant. OKs for this version? --- a/sys/lib/libkern/libkern.h +++ b

Compile time assert macro

2013-05-03 Thread Stefan Fritsch
Hi, I think a CTASSERT macro like in FreeBSD would be nice. It could be used to verify assumptions about type and struct sizes. This should work on gcc 2.9.5, too, but I haven't tested it. --- sys/lib/libkern/libkern.h +++ sys/lib/libkern/libkern.h @@ -138,6 +138,9 @@ abs(int j) #endif #endif