Re: [PATCH v6 2/3] Add default implementation of fenv.h and all methods

Corinna Vinschen <[email protected]>
Newsgroups gmane.comp.lib.newlib
Message-ID <[email protected]>
On Aug  9 09:50, Corinna Vinschen wrote:
> On Aug  8 15:04, Joel Sherrill wrote:
> > On Thu, Aug 8, 2019 at 2:05 PM Corinna Vinschen <[email protected]> wrote:
> > 
> > > On Aug  8 11:27, [email protected] wrote:
> > > > +/*
> > > > + * This is a non-functional implementation that should be overridden
> > > > + * by an architecture specific implementation in
> > > newlib/libm/machine/ARCH.
> > > > + *
> > > > + * The implmentation must defined FE_DFL_ENV to point to a default
> > > > + * environment of type fenv_t.
> > > > + */
> > > > +static const fenv_t fe_dfl_env = { 0 };
> > > > +const fenv_t *_fe_dfl_env = &fe_dfl_env;
> > >
> > > Bummer.  This doesn't work.  The problem is that Cygwin needs to
> > > initialize fe_dfl_env, like this:
> > >
> > >   fegetenv (&fe_dfl_env);
> > >
> > > However, even if I drop `const' as in Cygwin, if fe_dfl_env is static
> > > I can't access it from the _feinitialise() function at DLL init time.
> > >
> > > I'm not quite sure how to fix this.  Any ideas?  Do I have to drop
> > > the idea to reuse this file and we need our own target-specific one?
> > >
> > 
> > I'm not opposed to making it non-const and not static. Whatever it
> > takes to make it work on Cygwin.
> 
> Ok, if nobody else disagrees.  I'll wait over the weekend.
> 
> I think, if the variable is non-static it should start with two
> underscores.  This was no problem in Cygwin which only exports symbols
> we add to a linker definition file, but in case of a "normal" lib, it
> makes probably sense not to pollute the namespace.
> 
> You don't have to create another patch in that case, I care for it.

Pushed with the req. changes for Cygwin.


Thanks,
Corinna

-- 
Corinna Vinschen
Cygwin Maintainer
Red Hat
signature.asc (application/pgp-signature, 833 B)
-----BEGIN PGP SIGNATURE-----

iQIzBAEBCAAdFiEEoVYPmneWZnwT6kwF9TYGna5ET6AFAl1RIZ8ACgkQ9TYGna5E
T6DbPRAAijNTRKQ7pIdpR91mAp/lIOFZ9Q2F7x9UqbuyQRG8ZNEMTvht+s2fQAJU
UoBMItkwIf6oZB8/nQcuNTIfuEDSwXRfZBQe7MTzep0jmr+d5PfLfFYLsM059qcz
8RbAoogVTvR9Q5L14kBs7KJlQDJ1XhMGGn2aI3Fzj5l3+iPaQVnoC8JOJr9r7SyI
HOl8/Kgw4jFvVeUVqblx1eTSXy3JxacUnTD5OOA6G7TOoSH+4/1M4a+n/pKdZ+Hs
4rWvWINUBLR/fZ0jj+sh+7I3LSVcdc1jUcnbHihXYsKk3/uq/hAODr+3P5a4ceo4
/caS81iEEuAZp9ifpaPqdc7c5R+JYsXihmeEGY3U/ZQsQ52nJj9vxyg/1YtOiEp0
z9nRGMQFiD7aIMFilxjdGxrRkJ9naW925DHc7qduY7KvOlArcZ7pkTavHfshoKzr
nydzVdpqnj1OeXG59E5qZI3y0piD4uAlr3FRDjuv6IWuV5zyntYH0dVy26C8l3nX
wxxMm24b/+ZEDzfbivdlhNiDnoHaF0nd/7JEAKLlArp3mQa8z1ZcfO7vp8MyQ6qG
8e42R6AJzfC+29FWks1Cbnvvp9AmbKUZEv8q/AUn8HAXltcLUo61vjZeoCHjDhB8
ecqdLL4p+nbCFV3E7ORPGobcbWvYDoYc2TmPwz8Dw9buofyK3lw=
=zCxe
-----END PGP SIGNATURE-----
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.