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

Linux strtod() - and 5.6.0-RC1

From:
Nick Ing-Simmons
Date:
March 11, 2000 03:41
Subject:
Linux strtod() - and 5.6.0-RC1
Message ID:
E12TkGg-00069D-00@mserv1c.u-net.net
Nick Ing-Simmons <nick@ing-simmons.net> writes:
>Nick Ing-Simmons <nick@ing-simmons.net> writes:
>>Sometimes it fails to compile that :
>>
>>Tk::Error: unparseable float at /home/p4work/Tk8/bugdir/../blib/lib/Tk/Scrollbar.pm line 27.
>
>It does that because errno == 84 which seems to be:
>
>
>"Invalid or incomplete multibyte or wide character"
>
>Why strtol?d() is producing that is beyond my current understanding.
>
>But it does seem to preculde using scrollbars in Tk apps :-(

This code in toke.c is failing for me :

#if defined(USE_LONG_DOUBLE) && (defined(HAS_STRTOLD) || !defined(VMS))
	    value = strtold(PL_tokenbuf,&tp);
#else
	    value = strtod(PL_tokenbuf,&tp);
#endif
	    if (*tp || errno) {
		if (errno) perror(PL_tokenbuf);
		Perl_die(aTHX_ "unparseable float '%s' %p %p %d %02x",
                               PL_tokenbuf,PL_tokenbuf,tp,errno,*tp);
            }
	    else
	    	sv_setnv(sv, value);
	}

The perror() and the extra args to the die are my debug.
It is far from clear to me why strtod() is used in 5.6.0 when 
Atof() was used in 5.005. 
What is even less clear is why strtod() is blathering on about 
wide chars when there are not any.


Summary of my perl5 (revision 5.0 version 6 subversion 0) configuration:
  Platform:
    osname=linux, osvers=2.2.5, archname=i686-linux-multi
    uname='linux bactrian 2.2.5 #56 sat oct 9 20:14:35 bst 1999 i686 unknown '
    config_args='-der -O -Dcc=gcc -Doptimize=-O2 -g -Dusemymalloc=n -Dusemultiplicity=y -Dusevfork=false'
    hint=recommended, useposix=true, d_sigaction=define
    usethreads=undef use5005threads=undef useithreads=undef usemultiplicity=define
    useperlio=undef d_sfio=undef uselargefiles=define 
    use64bitint=undef use64bitall=undef uselongdouble=undef usesocks=undef
  Compiler:
    cc='gcc', optimize='-O2 -g', gccversion=egcs-2.91.66 19990314 (egcs-1.1.2 release)
    cppflags='-DDEBUGGING -fno-strict-aliasing -I/usr/local/include'
    ccflags ='-DDEBUGGING -fno-strict-aliasing -I/usr/local/include -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64'
    stdchar='char', d_stdstdio=define, usevfork=false
    intsize=4, longsize=4, ptrsize=4, doublesize=8
    d_longlong=define, longlongsize=8, d_longdbl=define, longdblsize=12
    ivtype='long', ivsize=4, nvtype='double', nvsize=8, Off_t='off_t', lseeksize=4
    alignbytes=4, usemymalloc=n, prototype=define
  Linker and Libraries:
    ld='gcc', ldflags =' -L/usr/local/lib'
    libpth=/usr/local/lib /lib /usr/lib
    libs=-lnsl -lndbm -lgdbm -ldbm -ldb -ldl -lm -lc -lposix -lcrypt
    libc=, so=so, useshrplib=false, libperl=libperl.a
  Dynamic Linking:
    dlsrc=dl_dlopen.xs, dlext=so, d_dlsymun=undef, ccdlflags='-rdynamic'
    cccdlflags='-fpic', lddlflags='-shared -L/usr/local/lib'


Characteristics of this binary (from libperl): 
  Compile-time options: DEBUGGING MULTIPLICITY USE_LARGE_FILES PERL_IMPLICIT_CONTEXT
  Locally applied patches:
  	v5.6.0-RC1
  Built under linux
  Compiled at Mar  8 2000 08:31:50
  @INC:
    /usr/local/lib/perl5.006/i686-linux
    /usr/local/lib/perl5.006/share
    /usr/local/lib/perl5.006/site/i686-linux
    /usr/local/lib/perl5.006/site/share
    /usr/local/lib/perl5.006/site/share
    .


-- 
Nick Ing-Simmons




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