This is the mail archive of the
mailing list for the glibc project.
Re: [PATCH roland/test-snan] Clean up math/test-snan.
- From: "Carlos O'Donell" <carlos at redhat dot com>
- To: libc-alpha at sourceware dot org
- Date: Fri, 06 Feb 2015 21:47:12 -0500
- Subject: Re: [PATCH roland/test-snan] Clean up math/test-snan.
- Authentication-results: sourceware.org; auth=none
- References: <20150206210012 dot 080072C3A9B at topped-with-meat dot com>
On 02/06/2015 04:00 PM, Roland McGrath wrote:
> This is a general cleanup of test-snan.c, intended not to change at all
> what it actually does. My real motivation for touching this test was to
> make it stop gratuitously using SA_SIGINFO (which it doesn't actually need).
> But when I saw the cruft and duplication rampant in this file, I had to act.
> Tested x86_64-linux-gnu.
> 2015-02-06 Roland McGrath <firstname.lastname@example.org>
> * math/test-snan.c: Drop unnecessary #include's of <stdlib.h>,
> <sys/time.h>, <string.h>, and <errno.h>.
> (dest_offset, dest_address, value, zero): Remove unused variables.
> (ldouble): Remove typedef.
> (myFPsighandler): Use simple handler signature, not SA_SIGINFO
> signature. Pass 1 to siglongjmp rather than 0 (which is converted to
> 1). Fix code style.
> (set_sigaction_FP, remove_sigaction_FP): Functions removed.
> (check): Function removed.
> (CHECK): New macro.
> (TEST_FUNC): Fix code style. Use CHECK macro rather than repeating
> boilerplate feclearexcept + feenableexcept + sigsetjmp code.
> Don't call set_sigaction_FP and remove_sigaction_FP here.
> (ldouble_test): Just use 'long double' as macro argument, no need for
> the 'ldouble' typedef.
> (do_test): Set up SIGFPE handler at start, using plain signal rather
> than sigaction. Fix code style.