This is the mail archive of the libc-alpha@sourceware.org mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH] [ARM] ] Add support for fenv_private on ARM


On Fri, 7 Mar 2014, Marcus Shawcroft wrote:

> IIRC the relevant part of test-fenv.c in the context of this thread is:
> 
>   errno = 0;
>   fesetenv (FE_NOMASK_ENV);
>   status = errno;
>   fesetenv (&saved);
>   if (status == ENOSYS)
> 
> There is one target in the glibc tree that appears to make use of
> errno in this manner, sysdeps/powerpc/fpu/fesetenv.c has a path that
> calls __fe_nomask_env_priv() setting ENOSYS, curiously this fesetenv()
> implementation always returns 0 even when setting errno, which seems
> rather odd to me, I wonder if  this is by design or simply a hang over
> from the days before fesetenv() gained a return value?

Given the lack of other cases setting errno in <fenv.h> functions, it 
might be better here simply to check the return value - and not to check 
errno at all.  But I think allowing failure should be conditional on 
something from math-tests.h saying the architecture intends that this 
feature might not be supported.

-- 
Joseph S. Myers
joseph@codesourcery.com


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]