This is the mail archive of the
newlib@sourceware.org
mailing list for the newlib project.
Re: Add global stdio streams support for reent small.
- From: Jeff Johnston <jjohnstn at redhat dot com>
- To: Douglas <info at ourairquality dot org>
- Cc: Newlib <newlib at sourceware dot org>
- Date: Thu, 1 Mar 2018 15:22:20 -0500
- Subject: Re: Add global stdio streams support for reent small.
- Authentication-results: sourceware.org; auth=none
- References: <121678a8-b3af-0e8f-613d-b46fca4bfa37@ourairquality.org>
Hi Douglas,
A few comments. First of all, please update comments on preprocessor #if,
#else statements to
include your changes (e.g. you have added a #else, what does this #else
mean...e.g. #else /* _REENT_SMALL || _REENT_GLOBAL_STDIO_STREAMS */
This will aid future maintainers to not have to look all the way back to
the original #if). This also applies to
comments for #else statements that are altered by your changes.
That said, I have one code comment.
In findfp.c std, you added "&& !defined(__REENT_GLOBAL_STDIO_STREAMS)" to
check if the lock for the file should be initialized. I don't understand
why you added this. AFAICT, this will affect current behaviour.
Regarding slots in the reent structs, yes, they are sometimes there for
fill, for backwards compatibility. Otherwise, everything needs to be
recompiled/relinked.
-- Jeff J.
On Wed, Feb 28, 2018 at 7:58 AM, Douglas <info@ourairquality.org> wrote:
> The global stdio streams option did not appear to work with reent small
> option, but these two options are both useful on a low memory system.
>
> This seems to simplify the reent small code in this area when using the
> global stdio streams option. The fake streams and some of the checking
> is not longer necessary.
>
> btw the __sf slot in the reent small struct _reent appears to be unused.
> Could that be removed, or is it fill for backwards compatibility?
>