Hi,
I agree; but, I felt that the feature would have proven useful because
my code is a protocol stack and packed structures are being used in the
packet headers and command frames (where, unfortunately, the size of the
comprising fields is not always in the increasing order of size). I wanted
to recompile the code using mspgcc and without much tinkering with the code.
Regards,
Sudhakar
" This e-mail, and any attachments thereto, are intended only for use by the
addressee(s) named herein and contain Honeywell confidential information. If
you are not the intended recipient of this e-mail, you are hereby notified
that any dissemination, distribution or copying which amounts to
misappropriation of this e-mail and any attachments thereto, is strictly
prohibited. If you have received this e-mail in error, please immediately
notify me and permanently delete the original and any copy of any e-mail and
any printout thereof."
-----Original Message-----
From: [email protected]
[mailto:[email protected]]on Behalf Of
[email protected]
Sent: Tuesday, January 04, 2005 17:29
To: [email protected]
Subject: RE: [Mspgcc-users] Problem with packed structures..
Hi,
> In reply to Chris' post - The IAR compiler handles such structures by
> accessing the data byte by byte. So, assigning the value, 0x1234 to "hg.b"
> (odd memory location) is done one byte at a time, i.e. 0x34 is moved in
> first and then 0x12 is moved into the next higher byte. As Chris rightly
> pointed out, it would've been nice if mspgcc could generate similar code
:-)
i don't agree because a) this produces more (assembler) code which needs
more flash,
b) it's slower and c) it's not necessary when you do define your struct as
{
int i;
char c;
}
instead of the ugly
{
char c;
int i;
}
.
You should follow the generally rule that a struct should start with the
greatest member and that the
member n should be smaller or equal then member n-1. But you also have to
bear in mind
the alignment.
Regards,
Rolf
-------------------------------------------------------
The SF.Net email is sponsored by: Beat the post-holiday blues
Get a FREE limited edition SourceForge.net t-shirt from ThinkGeek.
It's fun and FREE -- well, almost....http://www.thinkgeek.com/sfshirt
_______________________________________________
Mspgcc-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/mspgcc-users