
3 Jun
2006
3 Jun
'06
10:24 p.m.
On 6/3/06, Thorsten Ottosen <thorsten.ottosen@dezide.com> wrote:
This is more a couple of questions that comments.
1. have I misunderstood aligmnet completely when I thought that a single data member was not guaranteed to be aligned, but an array ways?
An array of some type gets the same alignment as a scalar of that type.
(your aligned types use a data member, your unaligned use a char array).
2. why is a char array used, and not, say, a T[1] array?
T[1] is given the same alignment by the compiler as T. Also, T is the wrong size except for the case where sizeof(T) == num_bytes. --Beman