develooper Front page | perl.perl5.porters | Postings from December 2013

[perl #120807] gmtime and localtime offsets are misdetected on 32-bit big-endian

Thread Next
From:
perlbug-followup
Date:
December 17, 2013 14:14
Subject:
[perl #120807] gmtime and localtime offsets are misdetected on 32-bit big-endian
Message ID:
rt-4.0.18-21822-1387248855-1686.120807-75-0@perl.org
# New Ticket Created by   
# Please include the string:  [perl #120807]
# in the subject line of all future correspondence about this issue. 
# <URL: https://rt.perl.org/Ticket/Display.html?id=120807 >



This is a bug report for perl from uwe@NetBSD.org,
generated with the help of perlbug 1.39 running under perl 5.18.1.


-----------------------------------------------------------------
[Please describe your issue here]

Configure script misdetects, or rather misreports, gmtime and
localtime offsets on 32-bit big-endian platforms, e.g. sparc or
powerpc.  Test programs print time_t variable pt with

    printf ("sGMTIME_max=%ld\n", pt);

ditto for sGMTIME_min, sLOCALTIME_max, sLOCALTIME_min.

If time_t is 64-bit, as it is on NetBSD, this results in garbage
truncated values to be printed since 64-bit value is printed with
32-bit %ld format.

The test programs should probably enforce known width with something
like:

    printf ("sGMTIME_max=%lld\n", (long long)pt);

etc.

[Please do not change anything below this line]
-----------------------------------------------------------------
---
Flags:
    category=core
    severity=low
---
Site configuration information for perl 5.18.1:

Configured by uwe at Mon Dec 16 04:11:05 MSK 2013.

Summary of my perl5 (revision 5 version 18 subversion 1) configuration:
   
  Platform:
    osname=netbsd, osvers=6.1_rc1, archname=powerpc-netbsd-thread-multi
    uname='netbsd pony 6.1_rc1 netbsd 6.1_rc1 (generic) #0: mon mar 11 03:09:49 msk 2013 uwe@amd64:homeuweworknetbsdbuild6objmacppcsysarchmacppccompilegeneric macppc '
    config_args='-sde -Duseshrplib -Duseithreads -Uusemymalloc'
    hint=recommended, useposix=true, d_sigaction=define
    useithreads=define, usemultiplicity=define
    useperlio=define, d_sfio=undef, uselargefiles=define, usesocks=undef
    use64bitint=undef, use64bitall=undef, uselongdouble=undef
    usemymalloc=n, bincompat5005=undef
  Compiler:
    cc='gcc', ccflags ='-pipe -O2 -pthread -I/usr/include -fno-strict-aliasing -fstack-protector -I/usr/pkg/include',
    optimize='-pipe -O2  -pthread  -I/usr/include',
    cppflags='-pipe -O2 -pthread -I/usr/include -fno-strict-aliasing -fstack-protector -I/usr/pkg/include'
    ccversion='', gccversion='4.5.3', gccosandvers=''
    intsize=4, longsize=4, ptrsize=4, doublesize=8, byteorder=4321
    d_longlong=define, longlongsize=8, d_longdbl=define, longdblsize=8
    ivtype='long', ivsize=4, nvtype='double', nvsize=8, Off_t='off_t', lseeksize=8
    alignbytes=8, prototype=define
  Linker and Libraries:
    ld='gcc', ldflags ='-Wl,-rpath,/usr/pkg/lib -fstack-protector -L/usr/pkg/lib'
    libpth=/lib /usr/lib /usr/pkg/lib
    libs=-lm -lcrypt -lpthread
    perllibs=-lm -lcrypt -lpthread
    libc=/lib/libc.so, so=so, useshrplib=true, libperl=libperl.so
    gnulibc_version=''
  Dynamic Linking:
    dlsrc=dl_dlopen.xs, dlext=so, d_dlsymun=undef, ccdlflags='-Wl,-E  -Wl,-R/usr/pkg/lib/perl5/5.18.0/powerpc-netbsd-thread-multi/CORE'
    cccdlflags='-DPIC -fPIC ', lddlflags='-shared  -L/usr/pkg/lib -fstack-protector'

Locally applied patches:
    

---
@INC for perl 5.18.1:
    /usr/pkg/lib/perl5/site_perl/5.18.0/powerpc-netbsd-thread-multi
    /usr/pkg/lib/perl5/site_perl/5.18.0
    /usr/pkg/lib/perl5/vendor_perl/5.18.0/powerpc-netbsd-thread-multi
    /usr/pkg/lib/perl5/vendor_perl/5.18.0
    /usr/pkg/lib/perl5/5.18.0/powerpc-netbsd-thread-multi
    /usr/pkg/lib/perl5/5.18.0
    .

---
Environment for perl 5.18.1:
    HOME=/home/uwe
    LANG (unset)
    LANGUAGE (unset)
    LC_CTYPE=ru_RU.KOI8-R
    LD_LIBRARY_PATH (unset)
    LOGDIR (unset)
    PATH=/home/uwe/bin:/usr/local/bin:/usr/local/sbin:/usr/games:/usr/pkg/bin:/usr/pkg/sbin:/bin:/sbin:/usr/bin:/usr/sbin:/usr/X11R7/bin
    PERL_BADLANG (unset)
    SHELL=/usr/pkg/bin/bash


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