Subject: Re: Size of members of a packed union
From: Kevin Cameron (Kevin.Cameron@nsc.com)
Date: Fri Jul 19 2002 - 10:36:33 PDT
Peter Flake wrote:
> At 11:58 AM 7/8/02 -0700, Stefen Boyd wrote:
> > -Section 3.7 - Size requirement(?) on members of a packed union
> >
> >* AI - Peter propose a straw man
>
> Because a packed union is a grouping of the same set of bits in different
> ways, the members of the union should be the same size, otherwise writing
> one member will not necessarily write all the bits.
>
> However this is more a question of taste rather than a fundamental language
> design issue. The alternative is to allow different sizes and assume right
> justification.
The issue with unions (packed or not) is how data from one type overlays
another. "Assume right justification" is a rather ill-defined statement, do you
mean assume "byte" alignment or "bit", and for integers overlaying byte
arrays which byte is the integer MSB?
Here's my first cut on a document on pointers and object-oriented access
which discusses alignment and endianness -
http://www.eda.org/verilog-ams/htmlpages/pointers+oo.pdf
Kev.
This archive was generated by hypermail 2b28 : Fri Jul 19 2002 - 10:48:16 PDT