[uClibc]diff of my tree -- including a new printf routine

Erik Andersen andersen at lineo.com
Tue Dec 19 00:22:12 UTC 2000


On Mon Dec 18, 2000 at 07:05:26AM -0600, Manuel Novoa III wrote:
> 
> Erik (and other uClibc users),
> 
> Here is a (rather large) patch from my tree.
> I've outlined the changes I've made below.
> Feedback is appreciated.

First of all -- I do have to appologize for not getting you timely feedback
thus far.  I have been burried up to my eyeballs in a project, and I've been
neglecting a lot of stuff recently.  Work gets that way sometimes.

> In particular, does anyone know of a test routine for printf?

I know that the Linux Standard Base has a test suite that is 
supposed to test such things.  
    http://www.linuxbase.org/test/

I imagine a perl script (or some hand coding) could be done
to extract their tests into a form more suitable for actually
being useful...


> Manuel
> 
> ---------------------------------------------------------------
> TODO:
> 
> Create a common header to configure the strto* functions.
> Create a header for prototypes of internal uClibc routines.
> Much more work needed on printing doubles.
> Test routines for strtod and dtostr.
> Test routine for printf.
> 
> ---------------------------------------------------------------
> 
> Fixed ctype.c for seperate object file generation per function.
> 
> New strtol and strtoul implementation (as posted a few days ago).
>    As mentioned in my post, these agree with the glibc versions
>    according the the test in the tests directory.
> 
> New strtod implementation (as posted a few days ago).
> 
> New (unsigned) long (long) int to string conversion routines.
>    The new routines don't use static buffers generate object
>    files as small as or smaller than the ones they replace.
> 
> Converted misc/assert/__assert.c, string/strerror.c,
>    string/strsignal.c, and net/addr.c to use the int to string
>    conversion functions above.  In the process, cut inet_ntoa.o
>    size in half (190 to 95) and fixed a bug in strsignal.c
> 
> Removal of obsolete files itoa.c and ltoa.c.
> 
> Disabled float prototypes in include/math.h and added double
>    prototypes for sin, cos, sqrt to match gcc builtins.
> 
> The (new) double to string routine I posted a few days ago.
> 
> Compile _fxstat.c, _lxstat.c, and _xstat.c with -fno-inline.
>    When I build with optimization turned on, these would
>    "infinitely inline" for lack of a better term.  Has anyone
>    else had this problem?

What gcc version are you using?  I didn't see that here.  
Debian potato box with gcc 2.95.2.

> New (and greatly improved) printf routine.  Still could have some bugs
>    but got correct all of the cases I through at it.  Does anyone
>    know of a test suite for printf?

See the lsb stuff and rip off their tests.  Unfortunately, their test
suite tries to take over you whole computer -- ugh...

>  * The previous vfprintf routine was almost completely rewritten with the
>  * goal of fixing some shortcomings and reducing object size.
>  *
>  * The summary of changes:
>  *
>  * Converted print conversion specification parsing from one big switch
>  *   to a method using string tables.  This new method verifies that the
>  *   conversion flags, field width, precision, qualifier, and specifier
>  *   appear in the correct order.  Many questionable specifications were
>  *   accepted by the previous code.  This new method also resulted in a
>  *   substantial reduction in object size of about 330 bytes (20%) from
>  *   the old version (1627 bytes) on i386, even with the following
>  *   improvements.
>  *
>  *     Implemented %n specifier as required by the standards.
>  *     Implemented proper handling of precision for int types.
>  *     Implemented # for hex and pointer, fixed error for octal rep of 0.
>  *     Implemented return of -1 on stream error.
>  *
>  * Added optional support for the GNU extension %m which prints the string
>  *   corresponding the errno.
>  *
>  * Added optional support for long long ints and unsigned long long ints
>  *   using the conversion qualifiers "ll", "L", or "q" (like glibc).
>  *
>  * Added optional support for doubles in a very limited form.  None of
>  *   the formating options are obeyed.  The string returned by __dtostr
>  *   is printed directly.
>  *
>  * Converted to use my (un)signed long (long) to string routines, which are
>  * smaller than the previous functions and don't require static buffers.

Hmm.  Sounds good.  I'll try to review these and get you some feedback as
quickly as I can.

 -Erik

--
Erik B. Andersen   email:  andersen at lineo.com
--This message was written using 73% post-consumer electrons--





More information about the uClibc mailing list