This is the mail archive of the
newlib@sourceware.org
mailing list for the newlib project.
SV: Non reentrant floating point functions?
- From: Rasmus Bo Sørensen <rboso at dtu dot dk>
- To: Eric Blake <eblake at redhat dot com>, "newlib at sourceware dot org" <newlib at sourceware dot org>
- Date: Fri, 13 Mar 2015 12:42:54 +0000
- Subject: SV: Non reentrant floating point functions?
- Authentication-results: sourceware.org; auth=none
- References: <F133D3A88829164DA3BFAED2E8BF58EC90961D at ait-pex02mbx04 dot win dot dtu dot dk>,<5502CF6F dot 6070609 at redhat dot com>
Hi Eric
Thank you for the quick reply.
> Any math function which is required to set errno on failure is not
> necessarily reentrant (or rather, _REENT_ONLY is designed to protect
> setups where errno is global rather than thread-local).
Looking into the reentrant and the non-reentrant functions in math.h,
I cannot see the different in how errno is set for the 'tan' function
(newlib/libm/mathfp/s_tan.c, which is reentrant) and the 'atan2' function
(newlib/libm/mathfp/s_atan2.c -> s_atangent.c, which is non-reentrant).
Maybe I am missing something?
Best regards,
Rasmus