On Saturday 06 October 2007 10:37, walter harms wrote:
> 
> Denys Vlasenko wrote:
> > On Sunday 30 September 2007 15:28, Loïc Grenié wrote:
> >>      I've tried to remove "common patterns" in the code.
> >>   First try: s/printf("%s", /puts(/ and s/fprintf(fp, "%s",
> >> \(.*\))/fputs(\1, fp)/
> >>   Patch attached.
> > 
> > -               printf("%s", error_message(ctx->errcode));
> > +               puts(error_message(ctx->errcode));
> > 
> > 
> > These are not equivalent. puts is adding "\n".
> > 
> > Apart from this - applied, thanks.
> > --
> 
> I am sorry but is the printf -> puts replacement not done
> automagicly by gcc ?
> 
> (http://www.ciselant.de/projects/gcc_printf/gcc_printf.html)

Yes, instead of optimizing "printf with string with no percents"
in glibc he optimized a subset of that in gcc.

I think this optimization is misplaced.
--
vda
_______________________________________________
busybox mailing list
[email protected]
http://busybox.net/cgi-bin/mailman/listinfo/busybox

Reply via email to