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  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.

> > P.S.: Apart from this problem we can use this now.  We should just add
> > the GNU specific FE_NOMASK_ENV soon, too.
> >
> 
> I'm not disagreeing but can that be added after this bulk is pushed?

Sure!  I wrote "soon" not "now" :)


Thanks,
Corinna

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

iQIzBAEBCAAdFiEEoVYPmneWZnwT6kwF9TYGna5ET6AFAl1NJagACgkQ9TYGna5E
T6BjYQ/+KG8dkWjsGgKFHj+vpPGeN98gtRxluyW1mA+RPMV0zz3ZbBA/+9DlxE0k
RoBAjdxpl+wc2AOahZNBBHVDBgoO3PUvTl7TmEbAVgzgHSj1l23qPBVoPP2Rkv+g
OVwzPeZPHSOQQTSG+gKb768aCGC45iBu56FXLv9lIolXFHUPfYTGQjd7fwVhv4H2
9vx/0qE0NzohGGoWkr6hl+6KiqRacQY6O/UtX+hg8IZkf5Hh1oLbwsJ3/PSdTkm7
gahGl0aqhJacVyRmpieggCfI5dbubEcszcU3Z1iwJW9jndnyiuXrknWNmMqw3Y3v
sk+nQWNSLQ2h7v286GPkBi3XaOJ5MIoT2n8TtJddA7tnCvZAtvajvFBj5dQCib4s
ebDa6schbLcITEIBVmGp8T5DuPRuBxiHLIXq7Ouv4GOzfi6r+hpbkhb30JjCotgc
xI/tnYZPnXb9zbx8BvkeX28jS8sPsXaczywUClEJlCncXQvByZKhJQQynsDi8HWc
aMFviTZ1ZSnWvTKna5ST9WA2QQYogaFBGQppYPhisfaR1DHeSVg4OFEL9uQDoTIB
/1U9ZUBDc630Pcmq3pFRYTyUBESUw+ISaL/+NHNcDeBFbkN4xGRianSHoXL3gB7T
7EFigDyy65JQm89Mvny4QbA+Imi/iArMpwpO3u9QasAGpI62/RE=
=Dw/Z
-----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.