This is the mail archive of the
newlib@sourceware.org
mailing list for the newlib project.
Re: *printf_r and reentrancy
Eric Blake wrote:
Jeff Johnston <jjohnstn <at> redhat.com> writes:
Yes, you are right for non-dynamic-reent configurations. An error on
the allocation will cause the errno to be set for _REENT which is
incorrect except in the case of dynamic reent. This needs to be fixed.
It's a bit of a can of worms. Do you want to make the changes or
would you prefer I do it?
Give me a day or two to tackle it (it will get me more familiar with the code),
I'll either ask for help or have something posted by then.
Am I correct that for any function in the __ prefix (such as __swsetup), there
are no backwards compatibility issues to worry about if I change the prototype
or rename it altogether?
There are some __ functions exposed via macros in newlib headers.
Normally, you just create an _r version of the function and if the
regular version needs to be around (e.g. is exposed via a macro), then
have the regular version call the _r routine with _REENT as a parameter.
The ones mentioned so far to be changed are all fine.
-- Jeff J.