Hi Devang,

> > yes, this need not be true in Ada, where bitfields can be placed
> > wherever you like,
> 
> Is it true for very first bitfield also ?

yes, it is true for all bitfields including the first.

> > for example
> >
> >   type Second_Bitfield_Not_At_Bitoffset_Zero is record
> >      A : Character;
> >      B : Integer;
> >   end record;
> >   for Second_Bitfield_Not_At_Bitoffset_Zero use record
> >      A at 0 range 0 .. 7;
> >      B at 0 range 27 .. 64;
> >   end record;
> 
> so here, range is not value  range. In that case size of B
> should be 64. No?

Here the range for B is 38 bits, which is enough to contain
the 32 bits of an integer.  The bit range needs to be at
least as wide as the type, it cannot be smaller.  This code
is perfectly legal and works fine with gcc.  That said, it
was a typo, I didn't mean to write 27..64, but 27..58.

Ciao,

Duncan.
_______________________________________________
llvm-commits mailing list
llvm-commits@cs.uiuc.edu
http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits

Reply via email to