On Mon, 13 Jun 2005, Chip Salzenberg via RT wrote:

> On Mon, Jun 13, 2005 at 08:38:30PM +0200, Leopold Toetsch wrote:
> > Chip Salzenberg wrote:
> > >On Mon, Jun 13, 2005 at 07:29:53PM +0200, Leopold Toetsch wrote:
> > >>The PMC allocation area is a big bunch of memory, where PMC-sized
> > >>pieces are carved out by the memory allocation system. There is no
> > >>union or compiler bug involved.
> > >
> > >But "PMC-sized" is defined in terms of the C sizeof operator, right?
> > 
> > Yes. And the size can be 20 or better it is with --optimize on an 32-bit 
> > system, which places every second PMC->num_val on an "odd" boundary.
> 
> If architecture X requires N-byte alignment for type T; and any
> compiler for architecture X defines any structure containing a member
> of type T as having a total structure size that is not a multiple of
> N, then that compiler really is buggy.  It's an inevitable consequence
> of how array allocation and pointer arithmetic are defined.

Yes.  The compiler does the right thing.  It sensibly reports 
that sizeof(PMC) = 24 for SPARC.

-- 
    Andy Dougherty              [EMAIL PROTECTED]

Reply via email to