NetBSD-Bugs archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

bin/51839: [PATCH] tests/lib/libm/t_scalbn: reset errno to 0 before calling scalbn*



>Number:         51839
>Category:       bin
>Synopsis:       [PATCH] tests/lib/libm/t_scalbn: reset errno to 0 before calling scalbn*
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    bin-bug-people
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Fri Jan 13 04:40:00 +0000 2017
>Originator:     Ngie Cooper
>Release:        7.0.2
>Organization:
>Environment:
n/a
>Description:
As stated by POSIX [*], the errno should be set to 0 before calling scalbn to test for correctness:

<<<

An application wishing to check for error situations should set errno to zero and call feclearexcept(FE_ALL_EXCEPT) before calling these functions. On return, if errno is non-zero or fetestexcept(FE_INVALID | FE_DIVBYZERO | FE_OVERFLOW | FE_UNDERFLOW) is non-zero, an error has occurred.

>>>

FreeBSD definitely needs this to be done. The attached patch fixes that.

* http://pubs.opengroup.org/onlinepubs/9699919799/functions/scalbln.html
>How-To-Repeat:

>Fix:



Home | Main Index | Thread Index | Old Index