Subject: Re: gcc4 lossage on mips kernels with semi-packed struct
To: Matthias Drochner <>
From: Simon Burge <>
List: tech-toolchain
Date: 05/17/2006 11:20:54
On Tue, May 16, 2006 at 03:52:02PM +0200, Matthias Drochner wrote:

> said:
> > A workaround is to simply reverse the last two lines in struct
> > bootpcontext, so that dhcp_serverip is aligned nicely. 
> Then it would be better to just use an uint32_t or so to store
> the IP address in "struct bootpcontext". There is no technical
> reason to have that thing "packed" here.
> Imho the "packed" attribute to "struct in_addr" is wrong, probably
> causes a lot of overhead on every access.

The "packed" was added back in '99 with the commit message:

 Add the `packed' attribute to structures which describe wire protocol data.

Given that an "int" can be packed any more than it already is,
I'm not sure why that was done.

> It might be a workaround for other compiler problems, but then
> there should be a better fix.

The "other compiler problems" bit is what I'm concerned about...  Where
else might we have similar problems in the tree?

Simon Burge                                   <>
NetBSD Development, Support and Service: