April 24, 2004
Juan C schrieb:
> That must be why you can't specify an alignment for array elements, my mistake.
> 
> Anyway, as align is currently implemented, what you describe is still not
> broken.

True, but the performance will be so sluggish that it kills all of the sense for alignment in the first place. There should be a way to specify that not only structure members, but also the complete structure size has to be aligned. When performance is conserned, the same size for element and for whole structure alignement makes sense. Otherwise there may also be some memory considerations etc. For any sort of file exchange, "packed" (byte aligment) is always appropriate.

-eye

April 26, 2004
Juan C wrote:

> <snip>
> 
>>How can it be desirable when it is meaningless? align(2) cannot, by definition,
>>yield a structure with a (size % 2) != 0. That is the very definition of packing
>>alignment!
> 
> </snip>
> 
> You're obviously using the definition of such which was _supposed to be_
> implemented, not that which _was_ implemented. I still say both should be
> available, perhaps fix align, but add an attribute to mean this kind.

If you want "this kind", there's always this:

	struct Test {
		align(2) short s;
		align(1) char c;
	}

Stewart.

-- 
My e-mail is valid but not my primary mailbox, aside from its being the unfortunate victim of intensive mail-bombing at the moment.  Please keep replies on the 'group where everyone may benefit.
1 2
Next ›   Last »