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

Manuel Novoa III mnovoa3 at bellsouth.net
Mon Dec 18 13:05:26 UTC 2000


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.
In particular, does anyone know of a test routine for printf?

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?

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?

 * 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.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: mjn3-uClibc.diff.gz
Type: application/x-gzip
Size: 18832 bytes
Desc: not available
Url : http://lists.busybox.net/pipermail/uclibc/attachments/20001218/d0af579a/attachment.bin 


More information about the uClibc mailing list