[PATCH] stdio: Add %m

Rob Landley rob at landley.net
Tue Jun 13 21:49:58 UTC 2006


On Tuesday 13 June 2006 5:19 pm, Rich Felker wrote:
> On Tue, Jun 06, 2006 at 07:22:58PM -0400, Rob Landley wrote:
> > On Monday 05 June 2006 12:49 pm, Shaun Jackman wrote:
> > > In particular, busybox uses %m and the maintainers will not accept
> > > patches converting this format to %s and strerror(errno) due to the
> > > latter taking more space by making, typically, two additional function
> > > calls -- one to __errno_location and one to strerror.
> >
> > Plus the extra code to load another argument onto the stack.  It adds up.
> >
> > Also because although the result looks bad, it isn't a build break or a
> > loss of functionality in the non-error case.  (Worst case scenario you
> > just don't see the error details.)
>
> Worst case is that printf fails due to invalid format string and does
> not print anything at all. I've explained before why it's dangerous
> for printf to continue after encountering an invalid format specifier
> and thus my implementation returns immediately with error upon
> encountering one.

Then yours is broken, we don't work with it, and never will.  (And I don't 
care.)

> Rich

Rob
-- 
Never bet against the cheap plastic solution.



More information about the busybox mailing list