How to stop gcc padding structs???

Grant Edwards grante@visi.com
Mon Jan 29 08:13:00 GMT 2001


On Tue, Jan 30, 2001 at 03:07:21AM +1100, Fergus Henderson wrote:

> > > Relying on sizeof to do this is *very* non-portable.
> > 
> > It's a device driver for a specific board.  It doesn't really
> > need to be portable.
> 
> The fact that it is a device driver for a specific board means that
> you're not going to try to port it to a different board.  But
> well-written device drivers do get ported to different operating
> systems, or compiled with different compilers.  For example, one
> reason why you might want to port to a different compiler is that you
> might discover that the compiler you're using is buggy.  Note that
> even upgrading to a later version of the same compiler may expose you
> to some of the same portability issues.

True.  I suppose for maximum portability I should just use
pointer arithmatic with hard-wired offsets.  It's just so ugly.

;)

-- 
Grant Edwards
grante@visi.com


More information about the Gcc mailing list