On Tue, 26 Jun 2018, Wilco Dijkstra wrote:

> > If the library does not set errno, clearly -fno-math-errno by default is 
> > appropriate (and is the default on Darwin).
> 
> Various librarys no longer set errno nowadays, for example BSD, MUSL, Bionic
> etc. For GLIBC 3.0 I'd propose to drop setting of errno as well since very few
> applications check errno after math functions that may set it (C89 support
> could be added using wrappers that set errno if required).

I think that's clearly something that would require new symbol versions 
for all affected symbols, or a new SONAME.

> That looks incorrect indeed but that's mostly a problem with -fmath-errno as 
> it
> would result in GCC assuming the function is const/pure when in fact it isn't.
> Does ATTR_MATHFN_FPROUNDING imply that errno is dead after the call?

No, it implies a pure function, so the previous errno value is still live 
after the call.

-- 
Joseph S. Myers
jos...@codesourcery.com

Reply via email to