Hello,

I'm porting a program from another platform to Palm,
and I encountered a structure alignment problem.  The
default Palm CodeWarrior alignment is "68K".  This
will make the size of a structure such as this

typedef struct tagHDR
{
char    Type[2];
char    ID[8];
char    Num[5];
char    Time[6];
} HDR;

22 bytes rather than the expected 21 bytes.
I changed the Struct Alignment setting in
CodeWarrior to "PowerPC", and now this
structure is 21 bytes.  This saves me from
rewriting some of our code, since there are places
in the program that depend on sizeof(HDR).

My question:  will this change of the alignment
setting cause problems on the Palm?  If there
is no known reason why the "68K" alignment
type is needed, I would prefer the PowerPC
setting, since that will save us a few bytes,
and memory on the Palm is very precious.

Thanks,

Greg Bungo

[EMAIL PROTECTED]
(630)949-3250  voice
(630)949-3299  fax



Reply via email to