develooper Front page | perl.perl5.porters | Postings from June 2019

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

Thread Previous | Thread Next
From:
ilmari
Date:
June 12, 2019 14:41
Subject:
Re: "perl -V"' output always lists "USE_PERL_ATOF" ??
Message ID:
d8jk1dqyigb.fsf@dalvik.ping.uio.no
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

Thread Previous | Thread Next


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About