Subject: Re: a new KNF (and some comments)
To: Atsushi Onoe <onoe@sm.sony.co.jp>
From: Jason Thorpe <thorpej@nas.nasa.gov>
List: tech-misc
Date: 01/21/2000 13:26:23
On Fri, 21 Jan 2000 11:25:44 +0900 (JST)
Atsushi Onoe <onoe@sm.sony.co.jp> wrote:
> > I think that should be written as:
> >
> > struct foo {
> > u_int8_t bar:1,
> > baz:5,
> > zap:2;
> > };
>
> If my memory is correct, all types except "(signed) int" and "unsigned int"
> for bitfield are prohibited by ANSI. And you should not expect the size or
> alignment of whole bitfields. This is why bitfield should not used in
> protool header.
If this is the case, then there is a fair bit of code in NetBSD, especially
older device drivers, which needs to be fixed to be strict about this.
In any case, GCC clearly supports it, because my Buslogic card works :-)
-- Jason R. Thorpe <thorpej@nas.nasa.gov>