On Mon Jul 30 03:00:08 2007, demerphq@gmail.com wrote:
Show quoted text> On 7/30/07, Andreas Koenig via RT <bug-Date-Simple@rt.cpan.org>
wrote:
Show quoted text>
> Thanks, Ill look into it.
>
> Yves
>
Spent some time investigating this, discovered it's a problem with 64-
bit integers and printf-style arguments. You have to be careful not to
push 64-bit items onto the printf stack if you're pulling them off as
32-bits. I was able to fix the failing tests on my platform (details
below) via this patch:
diff Simple.xs.orig Simple.xs
384,385c384,385
< RETVAL = newSVpvf ("%04d-%02d-%02d", ymd[0] % 10000,
< ymd[1], ymd[2]);
---
Show quoted text> RETVAL = newSVpvf ("%04d-%02d-%02d", (int)(ymd[0] %
10000),
Show quoted text> (int)ymd[1], (int)ymd[2]);
401,402c401,402
< RETVAL = newSVpvf ("%04d%02d%02d", ymd[0] % 10000,
< ymd[1], ymd[2]);
---
Show quoted text> RETVAL = newSVpvf ("%04d%02d%02d", (int)ymd[0] % 10000,
> (int)ymd[1], (int)ymd[2]);
The patch is pretty crude, however it should set you in the right
direction.
Summary of my perl5 (revision 5 version 8 subversion 8) configuration:
Platform:
osname=linux, osvers=2.6.9-42.elsmp, archname=i686-linux-64int
uname='linux sembtsap05rh4 2.6.9-42.elsmp #1 smp wed jul 12
23:27:17 edt 2006 i686 i686 i386 gnulinux '
config_args='-Duseshrplib -Duse64bitint -Duse64bitdouble -
Dprefix=/opt/perl/5.8.8 -Dscriptdir=/opt/perl/5.8.8/bin -
Dinstallprefix=/tmp/kalm/build_perl/5.8.8/core/dist//opt/perl/5.8.8 -
Darchlib=/opt/perl/5.8.8/lib/i686-linux -Dprivlib=/opt/perl/5.8.8/lib -
Dsitearch=/opt/perl/5.8.8/lib/site_perl/i686-linux -
Dsitelib=/opt/perl/5.8.8/lib/site_perl -
Dlocincpth=/opt/local/include /usr/local/BerkeleyDB/include -
Dloclibpth=/opt/local/lib /usr/local/BerkeleyDB/lib -
Dperl5=/opt/perl/5.8.8/bin/perl -des'
hint=recommended, useposix=true, d_sigaction=define
usethreads=undef use5005threads=undef useithreads=undef
usemultiplicity=undef
useperlio=define d_sfio=undef uselargefiles=define usesocks=undef
use64bitint=define use64bitall=undef uselongdouble=undef
usemymalloc=n, bincompat5005=undef
Compiler:
cc='cc', ccflags ='-fno-strict-aliasing -pipe -Wdeclaration-after-
statement -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -
I/usr/include/gdbm',
optimize='-O2',
cppflags='-fno-strict-aliasing -pipe -Wdeclaration-after-
statement -I/usr/include/gdbm'
ccversion='', gccversion='3.4.6 20060404 (Red Hat 3.4.6-3)',
gccosandvers=''
intsize=4, longsize=4, ptrsize=4, doublesize=8, byteorder=12345678
d_longlong=define, longlongsize=8, d_longdbl=define, longdblsize=12
ivtype='long long', ivsize=8, nvtype='double', nvsize=8,
Off_t='off_t', lseeksize=8
alignbytes=4, prototype=define
Linker and Libraries:
ld='cc', ldflags =''
libpth=/lib /usr/lib /usr/local/lib
libs=-lnsl -lgdbm -ldb -ldl -lm -lcrypt -lutil -lc
perllibs=-lnsl -ldl -lm -lcrypt -lutil -lc
libc=/lib/libc-2.3.4.so, so=so, useshrplib=true, libperl=libperl.so
gnulibc_version='2.3.4'
Dynamic Linking:
dlsrc=dl_dlopen.xs, dlext=so, d_dlsymun=undef, ccdlflags='-Wl,-E -
Wl,-rpath,/opt/perl/5.8.8/lib/i686-linux/CORE'
cccdlflags='-fpic', lddlflags='-shared'
Characteristics of this binary (from libperl):
Compile-time options: PERL_MALLOC_WRAP USE_64_BIT_INT USE_LARGE_FILES
USE_PERLIO
Built under linux
Compiled at Aug 10 2007 11:35:40
%ENV:
PERL5LIB="/vobs/irm/src/perl/lib:/vobs/kalm/src/perl/lib"
@INC:
/vobs/irm/src/perl/lib
/vobs/kalm/src/perl/lib
/opt/perl/5.8.8/lib/i686-linux
/opt/perl/5.8.8/lib
/opt/perl/5.8.8/lib/site_perl/i686-linux
/opt/perl/5.8.8/lib/site_perl
/opt/perl/5.8.8/lib/site_perl