This is the mail archive of the
ecos-discuss@sources.redhat.com
mailing list for the eCos project.
Re: How to stop gcc padding structs???
- To: Jonathan Larmour <jlarmour at redhat dot com>
- Subject: Re: [ECOS] How to stop gcc padding structs???
- From: Grant Edwards <grante at visi dot com>
- Date: Mon, 29 Jan 2001 11:57:08 -0600
- Cc: ecos-discuss at sources dot redhat dot com
- References: <20010128124058.A9989@visi.com> <3A75AD28.3F252CD3@redhat.com>
On Mon, Jan 29, 2001 at 05:49:28PM +0000, Jonathan Larmour wrote:
> It's generally non-portable to rely on struct layout matching
> hardware, and just because gcc can be coerced to do it doesn't
> make it wise, nor guarantee it on different architectures (or
> different versions of gcc!). It is better practice to use
> accessor macros instead.
>
> And no, I know Red Hat don't always practice what we preach,
> but we *should*.
I know, but debugging is a royal pain when GDB doesn't know
about the structure of the peripheral and you've got to work
off of hex memory dumps just like the bad old days.
--
Grant Edwards
grante@visi.com