in reply to Re^6: Perl 64-bit versions
in thread Perl 64-bit versions

That has always worked in 64bitint perls!

Running perl-all -we $v="";vec($v,2**32,1)=1 : skipping 5.003 .. 5.13.11 : === base/perl5.14.0 5.014000 i686-linux-64int === base/tperl5.14.0 5.014000 i686-linux-thread-multi-64int-ld === base/perl5.14.1 5.014001 i686-linux-64int === base/tperl5.14.1 5.014001 i686-linux-thread-multi-64int-ld === base/perl5.14.2 5.014002 i686-linux-64int === base/tperl5.14.2 5.014002 i686-linux-thread-multi-64int-ld === base/perl5.15.0 5.015000 i686-linux-64int === base/tperl5.15.0 5.015000 i686-linux-thread-multi-64int-ld === base/perl5.15.1 5.015001 i686-linux-64int === base/tperl5.15.1 5.015001 i686-linux-thread-multi-64int-ld === base/perl5.15.2 5.015002 i686-linux-64int === base/tperl5.15.2 5.015002 i686-linux-thread-multi-64int-ld === base/perl5.15.3 5.015003 i686-linux-64int === base/tperl5.15.3 5.015003 i686-linux-thread-multi-64int-ld === base/perl5.15.4 5.015004 i686-linux-64int === base/tperl5.15.4 5.015004 i686-linux-thread-multi-64int-ld === base/perl5.15.5 5.015005 i686-linux-64int === base/tperl5.15.5 5.015005 i686-linux-thread-multi-64int-ld === base/perl5.15.6 5.015006 i686-linux-64int === base/tperl5.15.6 5.015006 i686-linux-thread-multi-64int-ld === base/perl5.15.7 5.015007 i686-linux-64int === base/tperl5.15.7 5.015007 i686-linux-thread-multi-64int-ld === base/perl5.15.8 5.015008 i686-linux-64int === base/tperl5.15.8 5.015008 i686-linux-thread-multi-64int-ld === /usr/bin/perl 5.014002 i586-linux-thread-multi Negative offset to vec in lvalue context at -e line 1. Exit status: 65280 === /pro/bin/perl 5.014001 i686-linux-64int-ld

Enjoy, Have FUN! H.Merijn

Replies are listed 'Best First'.
Re^8: Perl 64-bit versions
by BrowserUk (Patriarch) on Mar 13, 2012 at 16:49 UTC
    That has always worked in 64bitint perls!

    What is this (in your ouput?):

    === /usr/bin/perl 5.014002 i586-linux-thread-multi Negative offset to vec in lvalue context at -e line 1.

    And this (on mine):

    C:\test>test -S=1 -L=12 5.014002 # +# perl version 1431374382 # +# offsets to vec 1070103942 224876390 1364159134 875710158 4060380287 # +# < 2**32 > 2**31 Negative offset to vec in lvalue context at C:/Perl64-14/site/lib/Bloo +m/Filter.pm line 206.

    Line 206 of Bloom::Filter:

    # flip the appropriate bits on print(), vec($self->{filter}, $_, 1) = 1 foreach @{$self->_get +_cells($key)}; ## print() added

    perl -V:

    C:\test>perl -V Summary of my perl5 (revision 5 version 14 subversion 2) configuration +: Platform: osname=MSWin32, osvers=5.2, archname=MSWin32-x64-multi-thread uname='' config_args='undef' hint=recommended, useposix=true, d_sigaction=undef useithreads=define, usemultiplicity=define useperlio=define, d_sfio=undef, uselargefiles=define, usesocks=und +ef use64bitint=define, use64bitall=undef, uselongdouble=undef usemymalloc=n, bincompat5005=undef Compiler: cc='cl', ccflags ='-nologo -GF -W3 -MD -Zi -DNDEBUG -Ox -GL -fp:pr +ecise -DWIN32 -D_CONSOLE -DNO_STRICT -DWIN64 - optimize='-MD -Zi -DNDEBUG -Ox -GL -fp:precise', cppflags='-DWIN32' ccversion='15.0.21022', gccversion='', gccosandvers='' intsize=4, longsize=4, ptrsize=8, doublesize=8, byteorder=12345678 d_longlong=undef, longlongsize=8, d_longdbl=define, longdblsize=8 ivtype='__int64', ivsize=8, nvtype='double', nvsize=8, Off_t='__in +t64', lseeksize=8 alignbytes=8, prototype=define Linker and Libraries: ld='link', ldflags ='-nologo -nodefaultlib -debug -opt:ref,icf -lt +cg -libpath:"C:\perl64-14\lib\CORE" -machine libpth=\lib libs=oldnames.lib kernel32.lib user32.lib gdi32.lib winspool.lib +comdlg32.lib advapi32.lib shell32.lib ole32.li perllibs=oldnames.lib kernel32.lib user32.lib gdi32.lib winspool.l +ib comdlg32.lib advapi32.lib shell32.lib ole3 libc=msvcrt.lib, so=dll, useshrplib=true, libperl=perl514.lib gnulibc_version='' Dynamic Linking: dlsrc=dl_win32.xs, dlext=dll, d_dlsymun=undef, ccdlflags=' ' cccdlflags=' ', lddlflags='-dll -nologo -nodefaultlib -debug -opt: +ref,icf -ltcg -libpath:"C:\perl64-14\lib\CORE Characteristics of this binary (from libperl): Compile-time options: MULTIPLICITY PERL_DONT_CREATE_GVSV PERL_IMPLICIT_CONTEXT PERL_IMPLICIT_SYS PERL_MALLOC_WRAP PERL_PRESERVE_IVUV PL_OP_SLAB +_ALLOC USE_64_BIT_INT USE_ITHREADS USE_LARGE_FILES USE_PERLIO USE_PERL_ATOF USE_SITECUSTOMIZE Locally applied patches: ActivePerl Build 1402 [295342] Built under MSWin32 Compiled at Oct 7 2011 15:19:36 @INC: C:/Perl64-14/site/lib C:/Perl64-14/lib .

    With the rise and rise of 'Social' network sites: 'Computers are making people easier to use everyday'
    Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
    "Science is about questioning the status quo. Questioning authority".
    In the absence of evidence, opinion is indistinguishable from prejudice.

    The start of some sanity?

      I can confirm the problem for 4060380287, both with 5.14.2 and 5.15.8 (64-bit)

      $ /usr/local/perl/5.14.2/bin/perl -we '$v=""; vec($v,4060380287,1)=1' Negative offset to vec in lvalue context at -e line 1. $ /usr/local/perl/5.15.8/bin/perl -we '$v=""; vec($v,4060380287,1)=1' Negative offset to vec in lvalue context at -e line 1.

      but not for 2**32 (and above — in which case it wraps around1).  Actually, it seems 2**31 .. 2**32-1 is buggy, though I haven't tested each and every one individually.

      For reference, my relevant config settings:

      ... Compiler: cc='gcc ', ccflags ='-D_REENTRANT -D_GNU_SOURCE -fno-strict-aliasi +ng -pipe -fstack-protector -I/usr/local/include -D_LARGEFILE_SOURCE - +D_FILE_OFFSET_BITS=64', optimize='-O2', cppflags='-D_REENTRANT -D_GNU_SOURCE -fno-strict-aliasing -pipe -f +stack-protector -I/usr/local/include' ccversion='', gccversion='4.3.2 [gcc-4_3-branch revision 141291]', + gccosandvers='' intsize=4, longsize=8, ptrsize=8, doublesize=8, byteorder=12345678 d_longlong=define, longlongsize=8, d_longdbl=define, longdblsize=1 +6 ivtype='long', ivsize=8, nvtype='double', nvsize=8, Off_t='off_t', + lseeksize=8 alignbytes=8, prototype=define ... Characteristics of this binary (from libperl): Compile-time options: HAS_TIMES MULTIPLICITY PERLIO_LAYERS PERL_DONT_CREATE_GVSV PERL_IMPLICIT_CONTEXT PERL_MALLOC_WRAP PERL_PRESERVE_IVUV PERL_USE_D +EVEL USE_64_BIT_ALL USE_64_BIT_INT USE_ITHREADS USE_LARGE_FILES USE_LOCALE USE_LOCALE_COLLATE USE_LOCALE_CTYPE USE_LOCALE_NUMERIC USE_PERLIO USE_PERL_ATOF USE_REENTRANT_API

      ___

      1 as I can find no mention in vec that the offset is limited to 32-bit on 64-bit builds, this could be considered a bug, too, even though it doesn't croak in this case.

      $ perl -wE '$v=""; vec($v,2**32+42,1)=1; say "wrapped" if vec($v,42,1) +' wrapped
        I can confirm the problem for 4060380287, both with 5.14.2 and 5.15.8 (64-bit) ... Actually, it seems 2**31 .. 2**32-1 is buggy,

        Ah! Okay. Thank you very much. Have you reported it, or shall I?

        Now to try and think of a work around ...


        With the rise and rise of 'Social' network sites: 'Computers are making people easier to use everyday'
        Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
        "Science is about questioning the status quo. Questioning authority".
        In the absence of evidence, opinion is indistinguishable from prejudice.

        The start of some sanity?

      That is the system perl: it is a 32bit perl (spot the missing 64int). Yet another reason not to use it.

      I never understood why people who make perl distributions on systems that perfectly support 64bit IV/UV's do not configure perl to use it (opposed to systems that are either 32bitall or 64bitall). I bet both older HP-UX and Windows fall into the either/or category.


      Enjoy, Have FUN! H.Merijn
        That is the system perl:

        Okay. That explains yours, but not the error from Bloom::Filter?


        With the rise and rise of 'Social' network sites: 'Computers are making people easier to use everyday'
        Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
        "Science is about questioning the status quo. Questioning authority".
        In the absence of evidence, opinion is indistinguishable from prejudice.

        The start of some sanity?