int always 32 bits on all platforms?

Walter Bright newshound1 at digitalmars.com
Thu Oct 22 18:59:49 PDT 2009


AJ wrote:
> How do you make ABC below work on a platform that requires 32-bit integers 
> to be aligned on 32-bit boundaries while keeping the layount and size of ABC 
> the same as on a platform that has no such alignment requirement?
> 
> struct ABC
> {
>     byte a;
>     int b; // may be improperly aligned on some platforms
>     int64 c; // same issue
> };

You don't require the layout or size of ABC to be the same on all 
platforms. C doesn't require it, why should D?



More information about the Digitalmars-d mailing list