P
pete
Keith said:I don't believe it's possible for a short and an array of shorts to
have different required alignments. If short is 16 bits, a compiler
might choose to use, say, 32-bit alignment for arrays of shorts, but
it still has to be able to access an array of shorts that's 16-bit
aligned. For some purposes, a single short object is equivalent to an
array of 1 short.
My argument comes from this
/* BEGIN new.c */
#include <stdio.h>
int main(void)
{
int array[2][2] = {0};
int *pointer = (int *)&array;
printf("%d\n", pointer[3]);
return 0;
}
/* END new.c */
not being OK, as has been discussed on comp.std.c before.