"perl -V"' output always lists "USE_PERL_ATOF" ??

--0000000000001a4d37058b1f146b
Content-Type: text/plain; charset="UTF-8"

Hi,
Is it possible to build perl 5.30.0 such that "perl -V" output does NOT
specify "USE_PERL_ATOF" ?

If not, then the obvious question is "Why do we bother specifying it ?"

Additionally, I would find it very helpful if there was something in
the "perl -V" output that would tell us whether perl was assigning floating
point values using strtod/strtold (whichever is appropriate for perl's
nvtype) or not.
This could probably best be achieved by having "perl -V" indicate the
status of both $Config{d_strtod} and $Config{d_strtold}.

For quadmath builds, there's currently no confusion as they always assign
floating point values using strtoflt128.
Yet their "perl -V" output still lists "USE_PERL_ATOF", which I find rather
puzzling.

Cheers,
Rob

--0000000000001a4d37058b1f146b
Content-Type: text/html; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable

<div dir=3D"ltr"><div>Hi,</div><div>Is it possible to build perl 5.30.0 suc=
h that &quot;perl -V&quot; output=C2=A0does NOT specify &quot;USE_PERL_ATOF=
&quot; ?</div><div><br></div><div>If not, then the obvious question is &quo=
t;Why do we=C2=A0bother specifying it ?&quot;</div><div><br></div><div>Addi=
tionally, I would find it very helpful if there was something in the=C2=A0&=
quot;perl -V&quot; output=C2=A0that would tell us whether perl was assignin=
g floating point values using strtod/strtold (whichever is appropriate for =
perl&#39;s nvtype) or not.</div><div>This could probably best be achieved b=
y having &quot;perl -V&quot; indicate the status of both $Config{d_strtod} =
and $Config{d_strtold}.</div><div><br></div><div>For quadmath builds, there=
&#39;s currently no confusion as they always assign floating point values u=
sing strtoflt128.</div><div>Yet their &quot;perl -V&quot; output still list=
s &quot;USE_PERL_ATOF&quot;, which=C2=A0I find=C2=A0rather puzzling.</div><=
div><br></div><div>Cheers,</div><div>Rob</div></div>

--0000000000001a4d37058b1f146b--
0
sisyphus359
6/12/2019 11:54:23 AM
perl.perl5.porters 47781 articles. 1 followers. Follow

5 Replies
49 Views

Similar Articles

[PageSpeed] 22

sisyphus <sisyphus359@gmail.com> writes:

> Hi,
> Is it possible to build perl 5.30.0 such that "perl -V" output does NOT
> specify "USE_PERL_ATOF" ?
>
> If not, then the obvious question is "Why do we bother specifying it ?"

Looking at the comments and code in perl.h, you can disable it by
passing -Accflags=-DUSE_PERL_ATOF=0 to Configure.

- ilmari
-- 
"The surreality of the universe tends towards a maximum" -- Skud's Law
"Never formulate a law or axiom that you're not prepared to live with
 the consequences of."                              -- Skud's Meta-Law
0
ilmari
6/12/2019 12:24:34 PM
--000000000000dc6c46058b2101c9
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable

Thanks.
I've tested, and I can verify that does remove  "USE_PERL_ATOF" from the
"perl -V" output.

But does configuring perl-5.30.0 with the "-Accflags=3D-DUSE_PERL_ATOF=3D0"
argument alter perl's functionality in any way ?

Cheers,
Rob

On Wed, Jun 12, 2019 at 10:41 PM Dagfinn Ilmari Manns=C3=A5ker <ilmari@ilma=
ri.org>
wrote:

> sisyphus <sisyphus359@gmail.com> writes:
>
> > Hi,
> > Is it possible to build perl 5.30.0 such that "perl -V" output does NOT
> > specify "USE_PERL_ATOF" ?
> >
> > If not, then the obvious question is "Why do we bother specifying it ?"
>
> Looking at the comments and code in perl.h, you can disable it by
> passing -Accflags=3D-DUSE_PERL_ATOF=3D0 to Configure.
>
> - ilmari
> --
> "The surreality of the universe tends towards a maximum" -- Skud's Law
> "Never formulate a law or axiom that you're not prepared to live with
>  the consequences of."                              -- Skud's Meta-Law
>

--000000000000dc6c46058b2101c9
Content-Type: text/html; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable

<div dir=3D"ltr"><div dir=3D"ltr"><div>Thanks.</div><div>I&#39;ve tested, a=
nd I can verify that does remove=C2=A0 &quot;USE_PERL_ATOF&quot; from the &=
quot;perl -V&quot; output.</div><div><br></div><div>But does=C2=A0configuri=
ng perl-5.30.0 with the &quot;-Accflags=3D-DUSE_PERL_ATOF=3D0&quot; argumen=
t alter perl&#39;s functionality in any way=C2=A0?</div><div><br></div><div=
>Cheers,</div><div>Rob<br></div></div></div><br><div class=3D"gmail_quote">=
<div class=3D"gmail_attr" dir=3D"ltr">On Wed, Jun 12, 2019 at 10:41 PM Dagf=
inn Ilmari Manns=C3=A5ker &lt;<a href=3D"mailto:ilmari@ilmari.org">ilmari@i=
lmari.org</a>&gt; wrote:<br></div><blockquote class=3D"gmail_quote" style=
=3D"margin:0px 0px 0px 0.8ex;padding-left:1ex;border-left-color:rgb(204,204=
,204);border-left-width:1px;border-left-style:solid">sisyphus &lt;<a href=
=3D"mailto:sisyphus359@gmail.com" target=3D"_blank">sisyphus359@gmail.com</=
a>&gt; writes:<br>
<br>
&gt; Hi,<br>
&gt; Is it possible to build perl 5.30.0 such that &quot;perl -V&quot; outp=
ut does NOT<br>
&gt; specify &quot;USE_PERL_ATOF&quot; ?<br>
&gt;<br>
&gt; If not, then the obvious question is &quot;Why do we bother specifying=
 it ?&quot;<br>
<br>
Looking at the comments and code in perl.h, you can disable it by<br>
passing -Accflags=3D-DUSE_PERL_ATOF=3D0 to Configure.<br>
<br>
- ilmari<br>
-- <br>
&quot;The surreality of the universe tends towards a maximum&quot; -- Skud&=
#39;s Law<br>
&quot;Never formulate a law or axiom that you&#39;re not prepared to live w=
ith<br>
=C2=A0the consequences of.&quot;=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 -- Skud&#39;=
s Meta-Law<br>
</blockquote></div>

--000000000000dc6c46058b2101c9--
0
sisyphus359
6/12/2019 2:12:27 PM
sisyphus <sisyphus359@gmail.com> writes:

> On Wed, Jun 12, 2019 at 10:41 PM Dagfinn Ilmari Mannsåker <ilmari@ilmari.org>
> wrote:
>
>> sisyphus <sisyphus359@gmail.com> writes:
>>
>> > Hi,
>> > Is it possible to build perl 5.30.0 such that "perl -V" output does NOT
>> > specify "USE_PERL_ATOF" ?
>> >
>> > If not, then the obvious question is "Why do we bother specifying it ?"
>>
>> Looking at the comments and code in perl.h, you can disable it by
>> passing -Accflags=-DUSE_PERL_ATOF=0 to Configure.
>
> Thanks.
> I've tested, and I can verify that does remove  "USE_PERL_ATOF" from the
> "perl -V" output.
>
> But does configuring perl-5.30.0 with the "-Accflags=-DUSE_PERL_ATOF=0"
> argument alter perl's functionality in any way ?

Looking at the code and comments in perl.h again
(https://github.com/perl/perl5/blob/maint-5.30/perl.h#L2353-L2378), the
difference is that it uses the system atof() function instead of the
perl-provided one:

#ifdef USE_PERL_ATOF
#   define Perl_atof(s) Perl_my_atof(s)
#   define Perl_atof2(s, n) Perl_my_atof3(aTHX_ (s), &(n), 0)
#else
#   define Perl_atof(s) (NV)atof(s)
#   define Perl_atof2(s, n) ((n) = atof(s))
#endif
#define my_atof2(a,b) my_atof3(a,b,0)


- ilmari
-- 
"A disappointingly low fraction of the human race is,
 at any given time, on fire." - Stig Sandbeck Mathisen
0
ilmari
6/12/2019 2:41:24 PM
--Sig_/ow0wUaoWj=vOgKkiD.kYXkJ
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: quoted-printable

On Wed, 12 Jun 2019 15:41:24 +0100, ilmari@ilmari.org (Dagfinn Ilmari
Manns=C3=A5ker) wrote:

> sisyphus <sisyphus359@gmail.com> writes:
>=20
> > On Wed, Jun 12, 2019 at 10:41 PM Dagfinn Ilmari Manns=C3=A5ker
> > <ilmari@ilmari.org> wrote:
> > =20
> >> sisyphus <sisyphus359@gmail.com> writes:
> >> =20
>  [...] =20
> >>
> >> Looking at the comments and code in perl.h, you can disable it by
> >> passing -Accflags=3D-DUSE_PERL_ATOF=3D0 to Configure. =20
> >
> > Thanks.
> > I've tested, and I can verify that does remove  "USE_PERL_ATOF"
> > from the "perl -V" output.
> >
> > But does configuring perl-5.30.0 with the
> > "-Accflags=3D-DUSE_PERL_ATOF=3D0" argument alter perl's functionality
> > in any way ? =20
>=20
> Looking at the code and comments in perl.h again
> (https://github.com/perl/perl5/blob/maint-5.30/perl.h#L2353-L2378),
> the difference is that it uses the system atof() function instead of
> the perl-provided one:
>=20
> #ifdef USE_PERL_ATOF
> #   define Perl_atof(s) Perl_my_atof(s)
> #   define Perl_atof2(s, n) Perl_my_atof3(aTHX_ (s), &(n), 0)
> #else
> #   define Perl_atof(s) (NV)atof(s)
> #   define Perl_atof2(s, n) ((n) =3D atof(s))
> #endif
> #define my_atof2(a,b) my_atof3(a,b,0)

Isn't that contradicting with -Accflags=3D-DUSE_PERL_ATOF=3D0 ?

Shouldn't the define be #if instead of #ifdef then?

> - ilmari

--=20
H.Merijn Brand  http://tux.nl   Perl Monger  http://amsterdam.pm.org/
using perl5.00307 .. 5.29   porting perl5 on HP-UX, AIX, and openSUSE
http://mirrors.develooper.com/hpux/        http://www.test-smoke.org/
http://qa.perl.org   http://www.goldmark.org/jeff/stupid-disclaimers/

--Sig_/ow0wUaoWj=vOgKkiD.kYXkJ
Content-Type: application/pgp-signature
Content-Description: OpenPGP digital signature

-----BEGIN PGP SIGNATURE-----

iQEzBAEBCAAdFiEEGolmczWuFi3lJEbAA6FHoT5dwJgFAl0HilAACgkQA6FHoT5d
wJjvVQgAt82A4RyKOPAKSXygR3SFaAU1qOpd2Q1WRVyY/WT1xbyrVjt3fwlGxv2N
evRJWXNpZESdHoxnHAsQ07NsP9DMLG6qd4qn9D6EQrlAf1utJj3pT+WVSh3BT8oA
x2Ui7B9gX3cHgRujWsdemL/SfYcNnSJgS0vezKJUv6t/Ad7mBbuZ79DgUkQjSxqY
1/bMcFG1J4XGFf2j0QAIUMO9bhCP6onDh1fPq/l+gjz4y77TITKtnH3ePdbKFqhW
fSs8iHR94V/IrjnK4FLdQBD1zDT5gYAE4uIyr2kMWdlaEAwOd0huXpcnWJLPTVxX
R2t97JtAeWdC3oFzyQCrD7FZ79dPEA==
=VJbs
-----END PGP SIGNATURE-----

--Sig_/ow0wUaoWj=vOgKkiD.kYXkJ--
0
h
6/17/2019 12:40:48 PM
"H.Merijn Brand" <h.m.brand@xs4all.nl> writes:

>> #ifdef USE_PERL_ATOF
>> #   define Perl_atof(s) Perl_my_atof(s)
>> #   define Perl_atof2(s, n) Perl_my_atof3(aTHX_ (s), &(n), 0)
>> #else
>> #   define Perl_atof(s) (NV)atof(s)
>> #   define Perl_atof2(s, n) ((n) = atof(s))
>> #endif
>> #define my_atof2(a,b) my_atof3(a,b,0)
>
> Isn't that contradicting with -Accflags=-DUSE_PERL_ATOF=0 ?
>
> Shouldn't the define be #if instead of #ifdef then?

Sorry, I didn't quote the entire relevant code.  Just above that,
there's this bit:

#ifndef USE_PERL_ATOF
#   ifndef _UNICOS
#       define USE_PERL_ATOF
#   endif
#else
#   if USE_PERL_ATOF == 0
#       undef USE_PERL_ATOF
#   endif
#endif

So it defaults to defined unless it's explicitly zero or we're on
Unicos(!).

- ilmari
-- 
"A disappointingly low fraction of the human race is,
 at any given time, on fire." - Stig Sandbeck Mathisen
0
ilmari
6/17/2019 3:57:18 PM
Reply: