Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Broken atof #11918

Closed
p5pRT opened this issue Jan 29, 2012 · 4 comments
Closed

Broken atof #11918

p5pRT opened this issue Jan 29, 2012 · 4 comments

Comments

@p5pRT
Copy link

p5pRT commented Jan 29, 2012

Migrated from rt.perl.org#109318 (status was 'resolved')

Searchable as RT109318$

@p5pRT
Copy link
Author

p5pRT commented Jan 29, 2012

From blgl@stacken.kth.se

Created by blgl@stacken.kth.se

use strict;
use warnings;
use POSIX;
use locale;

setlocale(LC_NUMERIC,"sv_SE");

printf("%g\n","3.14e+9"); # prints "3,14e+09\n"
printf("%g\n","3,14e+9"); # prints "3,14e+09\n"
printf("%g\n","3.14e-9"); # prints "3,14e-09\n"
printf("%g\n","3,14e-9"); # prints "3\n" *** WRONG! ***

# Perl_my_atof tries to be clever with locale decimal separators
# and falls on its face​:
# /* Scan the number twice; once using locale and once without;
# * choose the larger result (in absolute value). */
# This heuristic fails for negative exponents.

Perl Info

Flags:
    category=core
    severity=medium

Site configuration information for perl 5.15.7:

Configured by blgl at Sun Jan 29 18:19:04 CET 2012.

Summary of my perl5 (revision 5 version 15 subversion 7) configuration:
   
  Platform:
    osname=darwin, osvers=10.8.0, archname=darwin-2level
    uname='darwin localhost.local 10.8.0 darwin kernel version 10.8.0: tue jun 7 16:33:36 pdt 2011; root:xnu-1504.15.3~1release_i386 i386 '
    config_args=''
    hint=recommended, useposix=true, d_sigaction=define
    useithreads=undef, usemultiplicity=undef
    useperlio=define, d_sfio=undef, uselargefiles=define, usesocks=undef
    use64bitint=define, use64bitall=define, uselongdouble=undef
    usemymalloc=n, bincompat5005=undef
  Compiler:
    cc='cc', ccflags ='-fno-common -DPERL_DARWIN -fno-strict-aliasing -pipe -fstack-protector -I/usr/local/include',
    optimize='-Os',
    cppflags='-fno-common -DPERL_DARWIN -fno-strict-aliasing -pipe -fstack-protector -I/usr/local/include'
    ccversion='', gccversion='4.2.1 (Apple Inc. build 5666) (dot 3)', gccosandvers=''
    intsize=4, longsize=8, ptrsize=8, doublesize=8, byteorder=12345678
    d_longlong=define, longlongsize=8, d_longdbl=define, longdblsize=16
    ivtype='long', ivsize=8, nvtype='double', nvsize=8, Off_t='off_t', lseeksize=8
    alignbytes=8, prototype=define
  Linker and Libraries:
    ld='env MACOSX_DEPLOYMENT_TARGET=10.3 cc', ldflags =' -fstack-protector -L/usr/local/lib'
    libpth=/usr/local/lib /usr/lib
    libs=-lutil -lc
    perllibs=-lutil -lc
    libc=, so=dylib, useshrplib=false, libperl=libperl.a
    gnulibc_version=''
  Dynamic Linking:
    dlsrc=dl_dlopen.xs, dlext=bundle, d_dlsymun=undef, ccdlflags=' '
    cccdlflags=' ', lddlflags=' -bundle -undefined dynamic_lookup -L/usr/local/lib -fstack-protector'

Locally applied patches:
    


@INC for perl 5.15.7:
    /usr/unstable/lib/perl5/site_perl/5.15.7/darwin-2level
    /usr/unstable/lib/perl5/site_perl/5.15.7
    /usr/unstable/lib/perl5/5.15.7/darwin-2level
    /usr/unstable/lib/perl5/5.15.7
    .


Environment for perl 5.15.7:
    DYLD_LIBRARY_PATH (unset)
    HOME=/Users/blgl
    LANG (unset)
    LANGUAGE (unset)
    LD_LIBRARY_PATH (unset)
    LOGDIR (unset)
    PATH=/Users/blgl/bin:/Users/blgl/bin/powerpc-apple-darwin:/usr/local/bin:/usr/local/sbin:/bin:/sbin:/usr/bin:/usr/sbin
    PERL_BADLANG (unset)
    SHELL=/bin/tcsh


@p5pRT
Copy link
Author

p5pRT commented Jun 26, 2012

From @doy

Fixed in 7878705.

@p5pRT
Copy link
Author

p5pRT commented Jun 26, 2012

From [Unknown Contact. See original ticket]

Fixed in 7878705.

@p5pRT
Copy link
Author

p5pRT commented Jun 26, 2012

@doy - Status changed from 'new' to 'resolved'

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant