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]

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


Hi Freddie,

Thanks for your comments.

> -----Original Message-----
> From: newlib-owner@sourceware.org [mailto:newlib-owner@sourceware.org] On
> Behalf Of Freddie Chopin
> Sent: Friday, June 07, 2013 5:23 PM
> To: newlib@sourceware.org
> Subject: Re: [RFC]New implementation of C89 streamio for resource limited
bare
> metal systems
> 
> W dniu 2013-06-07 11:05, Bin Cheng pisze:
> > 2) This implementation substantially decreases stack usage for printf
> > routines, because of a char[1024] buffer in newlib's __sbprintf
function.
> > This can be fixed by simply disabling the optimization for un-buffered
> > files (under configuration options).
> >
> > So we can even drop this implementation and achieving same code size
goal.
> 
> An option like that (maybe even an configure option for setting BUFSIZ
without
> messing with source files [; ) would be great! Unbuffered stream should be
> unbuffered [;

I missed the part that __sbprintf has been changed into non-inline, so the
big buffer isn't a problem anymore. Though __sbprintf can be guarded by an
option still.

> 
> > But one challenge is how to make floating point weak symbol without
> > re-implement the stream io routines, because floating point is tight
> > coupled with integer in current implementation.
> 
> Well, if you don't want to use floating point AT ALL you can just redefine
all
> *printf to be *iprintf (and the same for scanf). I guess it would be
enough to
> have sth like this added to compilation:
> 
> -Dprintf=iprintf -Dfprintf=fiprintf -Dsprintf=siprintf ...
> -Dscanf=iscanf -Dfscanf=fiscanf -Dsscanf=siscanf ... (for all available
> "types" of these functions)
It requires lots of change of command line options, but yes, this should
work.

> 
> The only case where this would NOT work is if newlib itself uses floating
> point variants of these functions "inside". Does it? In that case maybe it
I don't think there is such case in  libc, yet not sure about libm.

Thanks.
bin




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