DSPRelated.com
Forums

Re : wrong sizeof value on a struct.

Started by regi...@gmail.com June 7, 2007
Hi Jeff
First, thanks for the answer.
Second, do you have any "nice" solution for it. I mean I don't want to
count bytes or use #define STR_T = 7. Can I force the compiler by any flag
not to align my struct to 4 bytes multiplies...?

Thanks
RegInfo.
Reggie-

> First, thanks for the answer.
> Second, do you have any "nice" solution for it. I mean I don't want to
> count bytes or use #define STR_T = 7. Can I force the compiler by any flag
> not to align my struct to 4 bytes multiplies...?

That I'm not sure of. But I can say that if you do manage to "non align" the data,
bad things will happen in terms of code performance and possibly also with expected
results.

TI C6x DSPs are designed and optimized to depend on 4-byte alignment for data and
8-byte alignment for instruction code... they are not like Intel x86 processors (with
design legacy extending back to the early 1980s) that allow odd/even byte alignment.

-Jeff