develooper Front page | perl.perl5.porters | Postings from September 2017

[perl #132145] POSIX::localtime not identical to CORE::localtime

Thread Previous
From:
slaven @ rezic . de
Date:
September 22, 2017 21:13
Subject:
[perl #132145] POSIX::localtime not identical to CORE::localtime
Message ID:
rt-4.0.24-16499-1506114827-891.132145-75-0@perl.org
# New Ticket Created by  slaven@rezic.de 
# Please include the string:  [perl #132145]
# in the subject line of all future correspondence about this issue. 
# <URL: https://rt.perl.org/Ticket/Display.html?id=132145 >



This is a bug report for perl from slaven@rezic.de,
generated with the help of perlbug 1.40 running under perl 5.27.4.


-----------------------------------------------------------------
The POSIX Pod says for localtime:

            This is identical to Perl's builtin "localtime()" function for
            converting seconds since the epoch to a date see "localtime" in
            perlfunc.

However, it is only identical if the optional argument is given ---
POSIX::localtime fails if the argument is missing:

$ perl5.27.4 -MPOSIX -e 'warn localtime(time); warn POSIX::localtime(time)'
5982322811752641 at -e line 1.
5982322811752641 at -e line 1.

$ perl5.27.4 -MPOSIX -e 'warn localtime(); warn POSIX::localtime()'    
2292322811752641 at -e line 1.
Usage: POSIX::localtime(time) at -e line 1.

This seems to be the case since 5.8.x, at least (checked with 5.8.8).

I would expect that the documentation is adjusted, or that POSIX::localtime
may deal with a missing argument.

-----------------------------------------------------------------
---
Flags:
    category=library
    severity=low
    module=POSIX
---
This perlbug was built using Perl 5.20.2 - Sat Jun  3 12:27:58 UTC 2017
It is being executed now by  Perl 5.27.4 - Thu Sep 21 00:25:50 CEST 2017.

Site configuration information for perl 5.27.4:

Configured by eserte at Thu Sep 21 00:25:50 CEST 2017.

Summary of my perl5 (revision 5 version 27 subversion 4) configuration:
   
  Platform:
    osname=linux
    osvers=3.16.0-4-amd64
    archname=x86_64-linux
    uname='linux cabulja 3.16.0-4-amd64 #1 smp debian 3.16.39-1+deb8u2 (2017-03-07) x86_64 gnulinux '
    config_args='-ds -e -Dprefix=/opt/perl-5.27.4 -Dusedevel -Dusemallocwrap=no -Dcf_email=srezic@cpan.org'
    hint=recommended
    useposix=true
    d_sigaction=define
    useithreads=undef
    usemultiplicity=undef
    use64bitint=define
    use64bitall=define
    uselongdouble=undef
    usemymalloc=n
    default_inc_excludes_dot=define
    bincompat5005=undef
  Compiler:
    cc='cc'
    ccflags ='-fwrapv -fno-strict-aliasing -pipe -fstack-protector-strong -I/usr/local/include -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -D_FORTIFY_SOURCE=2'
    optimize='-O2'
    cppflags='-fwrapv -fno-strict-aliasing -pipe -fstack-protector-strong -I/usr/local/include'
    ccversion=''
    gccversion='4.9.2'
    gccosandvers=''
    intsize=4
    longsize=8
    ptrsize=8
    doublesize=8
    byteorder=12345678
    doublekind=3
    d_longlong=define
    longlongsize=8
    d_longdbl=define
    longdblsize=16
    longdblkind=3
    ivtype='long'
    ivsize=8
    nvtype='double'
    nvsize=8
    Off_t='off_t'
    lseeksize=8
    alignbytes=8
    prototype=define
  Linker and Libraries:
    ld='cc'
    ldflags =' -fstack-protector-strong -L/usr/local/lib'
    libpth=/usr/local/lib /usr/lib/gcc/x86_64-linux-gnu/4.9/include-fixed /usr/include/x86_64-linux-gnu /usr/lib /lib/x86_64-linux-gnu /lib/../lib /usr/lib/x86_64-linux-gnu /usr/lib/../lib /lib
    libs=-lpthread -lnsl -lgdbm -ldb -ldl -lm -lcrypt -lutil -lc -lgdbm_compat
    perllibs=-lpthread -lnsl -ldl -lm -lcrypt -lutil -lc
    libc=libc-2.19.so
    so=so
    useshrplib=false
    libperl=libperl.a
    gnulibc_version='2.19'
  Dynamic Linking:
    dlsrc=dl_dlopen.xs
    dlext=so
    d_dlsymun=undef
    ccdlflags='-Wl,-E'
    cccdlflags='-fPIC'
    lddlflags='-shared -O2 -L/usr/local/lib -fstack-protector-strong'


---
@INC for perl 5.27.4:
    /opt/perl-5.27.4/lib/site_perl/5.27.4/x86_64-linux
    /opt/perl-5.27.4/lib/site_perl/5.27.4
    /opt/perl-5.27.4/lib/5.27.4/x86_64-linux
    /opt/perl-5.27.4/lib/5.27.4

---
Environment for perl 5.27.4:
    HOME=/home/eserte
    LANG=en_US.UTF-8
    LANGUAGE (unset)
    LD_LIBRARY_PATH (unset)
    LOGDIR (unset)
    PATH=/usr/local/bin:/usr/bin:/bin:/usr/local/sbin:/usr/sbin:/sbin:/home/eserte/bin/linux-gnu:/home/eserte/bin/sh:/home/eserte/bin:/home/eserte/bin/pistachio-perl/bin:/usr/games:/home/eserte/devel
    PERLDOC=-MPod::Perldoc::ToTextOverstrike
    PERL_BADLANG (unset)
    SHELL=/bin/zsh


Thread Previous


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