[PATCH v4] Only build libm with -fno-math-errno (bug 24024)

Joseph Myers joseph@codesourcery.com
Wed Jan 2 23:55:00 GMT 2019


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



More information about the Libc-alpha mailing list