Re : wrong sizeof value on a struct. - regi...@gmail.com - Jun 7 11:18:36 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.

(You need to be a member of code-comp -- send a blank email to code-comp-subscribe@yahoogroups.com )
Re: Re : wrong sizeof value on a struct. - Jeff Brower - Jun 7 12:52:46 2007
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

(You need to be a member of code-comp -- send a blank email to code-comp-subscribe@yahoogroups.com )