This is the mail archive of the newlib@sourceware.org mailing list for the newlib project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[RFC]New implementation of C89 streamio for resource limited bare metal systems


Hi all,

As you may noticed that we have up-streamed several patches further cutting
down library size for resource limited small systems, thanks for reviewing
and committing them.  The codes come from library work (so called
newlib-nano) in GNU Tools for ARM Embedded Processors, and we want to
upstream them to attract even more practice of newlib for small systems, and
of course lessen our maintenance effort too. 

Apart from these up-streamed patches, there is one more part of work:
re-implemented stream io routines.  Though they are based on the original
newlib's implementation, I see no easy way to merge them with existing
implementation even by means of configuration options. Because we have made
substantial modifications, including: 1) strictly follow C89 standards to
parse format string; 2) remove conversion specifier characters not in C89
standards; 3) make floating point formatted IO weak symbol and be linked if
necessary (this part can work with configuration options); 4) make i-family
stream io routines alias to standard ones because they are unnecessary by 3;
and many other changes.  Nevertheless, you could find the implementation is
quite straightforward.

I understand that any assessment can only be made after seeing the details,
so here writing this message and attaching source code of the
implementation, hopefully we can work out a way.  Even if it cannot be
merged, we also want to hear suggestions to keep improving it in our tool
chain.

The attachment includes 8 files as:
1)  vfprintf.c         //top level parser
    vfprintf_float.c   //floating point
    vfprintf_i.c       //integer and strings, etc.
    vfprintf_local.h   //local include file

2)  vfscanf.c          //top level parser
    vfscanf_float.c    //floating point
    vfscanf_i.c        //integer and strings, etc.
    vfscanf_local.h    //local include file


Any comments will be appreciated, thanks very much.
Bin

Attachment: streamio-sources.tar.bz2
Description: Binary data


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]