svn commit: [25930] trunk/busybox/shell

Mike Frysinger vapier at gentoo.org
Sat Apr 4 13:16:55 UTC 2009


On Saturday 04 April 2009 08:30:56 Denys Vlasenko wrote:
> On Thursday 02 April 2009 16:08, Mike Frysinger wrote:
> > On Thursday 02 April 2009 09:46:28 vda at busybox.net wrote:
> > > +ash_arith(const char *s)
> > > +{
> > > +	arith_eval_hooks_t math_hooks;
> > > +	arith_t result;
> > > +	int errcode = 0;
> > > +
> > > +	math_hooks.lookupvar = lookupvar;
> > > +	math_hooks.setvar = setvar;
> > > +	math_hooks.endofname = endofname;
> >
> > might read simpler as:
> > arith_eval_hooks_t math_hooks = {
> > 	.lookupvar = lookupvar,
> > 	.setvar = setvar,
> > 	.endofname = endofname,
> > };
> > same for hush
>
> I'm a bit reluctant to use struct initializers.
> gcc sometimes does atrocious things, like creating
> a constant copy of this struct and memcpy'ing it,
> when memset or just assignments would be better.
>
> We used to have 0.5k of .data in hdparm just because of this.

that's true ... ive stopped doing that in u-boot code for the same reason.  
seems the logic for when it makes sense for that is pretty screwed up in gcc 
atm.
-mike
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 836 bytes
Desc: This is a digitally signed message part.
URL: <http://lists.busybox.net/pipermail/busybox/attachments/20090404/209f8bba/attachment.pgp>


More information about the busybox mailing list