Structure alignment problem
Doug Evans
dje@transmeta.com
Mon Nov 4 08:50:00 GMT 2002
William A. Gatliff writes:
> Grant:
>
> On Mon, Nov 04, 2002 at 10:11:56AM -0600, Grant Edwards wrote:
> > On Mon, Nov 04, 2002 at 04:10:03PM +0000, Yves Rutschle wrote:
> > > On Mon, Nov 04, 2002 at 09:05:15AM -0600, Grant Edwards wrote:
> > > > I beat my head against that one for a couple days and never
> > > > figured it out. I asked on the gcc mailing list and all I got
> > > > were adminishments for trying to use structs to layout data in
> > > > an externally defined manner.
> > >
> > > How else can you do it? Sprintf everything as text? :-)
> >
> > Use memcpy() to transfer data to and from an array of unsigned
> > chars at hard-wired offsets.
>
> Can you imagine having to look at code like that a year later? :^)
>
> Yep, structure-defined i/o is evil. But the alternatives are much worse...
Do both? As in include/elf/external.h in binutils/gdb releases?
[or am I missing the point ...]
------
Want more information? See the CrossGCC FAQ, http://www.objsw.com/CrossGCC/
Want to unsubscribe? Send a note to crossgcc-unsubscribe@sources.redhat.com
More information about the crossgcc
mailing list