This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
Re: [PATCH v4] Only build libm with -fno-math-errno (bug 24024)
- From: Joseph Myers <joseph at codesourcery dot com>
- To: Aurelien Jarno <aurelien at aurel32 dot net>
- Cc: <libc-alpha at sourceware dot org>
- Date: Wed, 2 Jan 2019 23:54:39 +0000
- Subject: Re: [PATCH v4] Only build libm with -fno-math-errno (bug 24024)
- References: <20190102232357.24730-1-aurelien@aurel32.net>
On Thu, 3 Jan 2019, Aurelien Jarno wrote:
> +static int
> +do_test (void)
> +{
> + char *msg;
> +
> + errno = 0;
> + msg = strerror (-3);
> + (void) msg;
> +
> + return errno;
My understanding is that the idea is that this will fail if errno is
wrongly nonzero after strerror. But it's implicitly relying on the
wrongly set errno not having 77 as its low-order 8 bits (because that
would result in the test being UNSUPPORTED), and not being a nonzero value
with low 8 bits zero (because WEXITSTATUS only returns the low 8 bits).
OK with errno != 0 returned instead, to avoid those issues.
--
Joseph S. Myers
joseph@codesourcery.com