At 2:17 PM -0700 2001/06/15, Scott Johnson (Bellevue) wrote:
> > From: Vital Cruvinel Ferreira [mailto:[EMAIL PROTECTED]]
>> #pragma options align=packed
>> typedef struct {
>>    UInt8 size8 : 8;
>>    UInt16 size16 : 16;
>>    UInt32 size32 : 32;
>> } T;
>> t.size16 = 5;   // runtime error
>
>That will never work.  The Dragonball CPU cannot access 16-bit or larger
>integers at an odd address, even though you have ordered the compiler to
>try.  If the structure *must* be laid out exactly like that for a good
>reason, then you need to access the bytes of size16 and size32 individually.
>Or you can move size8 to the end of the structure.

No, it's the C compiler's job to generate whatever opcodes are required to support the 
packing rule and member sizes of the structure. But that doesn't seem to be happening 
in this case, so it's a bug.

Regards,

Jim Schram
Palm Incorporated
Partner Engineering


-- 
For information on using the Palm Developer Forums, or to unsubscribe, please see 
http://www.palmos.com/dev/tech/support/forums/

Reply via email to