This is the mail archive of the ecos-discuss@sources.redhat.com mailing list for the eCos project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: data alignment issues


On Thu, Aug 09, 2001 at 08:43:03AM -0600, Trenton D. Adams wrote:
> Why not send structures if it works?  After all, if I've tested it and
> there isn't any problems, then it's no problem right?  Is there any
> better way sending data?  I suppose I could send the structure one field
> at a time

What you are say is that it works today with gcc verions X for the
target, and MSVC version Y for the host. New version of the compilers
may decide to layout the structures differently. Borland may do
something different. The next versions of gcc may do something
different. MS may change there compiler. At that point, you have to
maintain old versions of the tools so you can rebuild your
application. 

What you should do is add some marshelling code. That takes the fields
from the structures and places them into an char * array at well known
addresses. You can easily write this in a partable way.

If you are not interested in portability, you can use the gcc
extensions.

        Andrew


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]