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

[perl #133945] ce6f496d720f6206455628425320badd95b07372 breaks floatformatting under GTK

Thread Previous | Thread Next
From:
sisyphus@cpan.org via RT
Date:
March 22, 2019 03:17
Subject:
[perl #133945] ce6f496d720f6206455628425320badd95b07372 breaks floatformatting under GTK
Message ID:
rt-4.0.24-27544-1553224612-225.133945-15-0@perl.org
Complete locale numbnut here, who is puzzled at how to account for the behaviour being demonstrated.
(Feel free to educate me ... or to ignore me.)

In perllocale docs I see:

<quote>
 Also Perl gives access to various C library functions through
 the POSIX module. Some of those functions are always affected by
 the current locale. For example, "POSIX::strftime()" uses
 "LC_TIME"; "POSIX::strtod()" uses "LC_NUMERIC";
 "POSIX::strcoll()" and "POSIX::strxfrm()" use "LC_COLLATE". All
 such functions will behave according to the current underlying
 locale, even if that locale isn't exposed to Perl space.
</quote>

With the perl that Dmitry has used, Perl_strtod is simply the C library function strtod().
Is the section I've just quoted stating that strtod (and hence Perl_strtod) "will behave according to the current underlying locale, even if that locale isn't exposed to Perl space" ?

If so, is that what's happening here ?
Is Gtk2 altering the "current underlying locale" in such a way that C's strtod() is affected, while perl's atof functionality (which Perl_strtod replaces) would be unaffected ?

FYI:
For a perl whose nvtype is "double" one can revert to using perl's less accurate atof functionality by configuring the build with '-Ud_strtod'.
For -Duselongdouble builds, to avoid Perl_strtod (ie C library's strtold) specify '-Ud_strtod -Ud_strtold'.
For -Dusequadmath builds one is currently stuck with Perl_strtod (ie C library's strtoflt128).

Cheers,
Rob



---
via perlbug:  queue: perl5 status: open
https://rt.perl.org/Ticket/Display.html?id=133945

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