Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bail early and avoid warnings on 32 bit Perl builds #7

Merged
merged 1 commit into from
Apr 12, 2022

Commits on Apr 12, 2022

  1. Bail early and avoid warnings on 32 bit Perl builds

    In 03d0996 the U64 class was removed
    and zipdetails was made 64 bit only. This causes warnings and test
    failures (t/porting/utils.t) on i386 builds of perl core when
    IO-Compress 2.105 was merged.
    
        # Failed test 83 - utils/zipdetails compiles at porting/utils.t line 85
        #      got "Integer overflow in hexadecimal number at utils/zipdetails line 1432.
        Integer overflow in hexadecimal number at utils/zipdetails line 2247.
        Integer overflow in hexadecimal number at utils/zipdetails line 2248.
        Integer overflow in hexadecimal number at utils/zipdetails line 2249.
        Integer overflow in hexadecimal number at utils/zipdetails line 2250.
        Integer overflow in hexadecimal number at utils/zipdetails line 2251.
        Integer overflow in hexadecimal number at utils/zipdetails line 2252.
        Integer overflow in hexadecimal number at utils/zipdetails line 2253.
        Integer overflow in hexadecimal number at utils/zipdetails line 2254.
        utils/zipdetails syntax OK
        "
        # expected "utils/zipdetails syntax OK
        "
        t/porting/utils .................................................. FAILED at test 83
    
    The code also makes use of unpack "Q" so it wouldn't work on 32 bit
    builds anyway.
    
    This patch adds a check very early in the script to see if the perl supports
    pack "Q", and it does not, indicating it is a 32 bit perl, then it bails out.
    If the script is run under -c it bails out without a message, and otherwise
    it prints out a message, and exits with error code 1.
    
        $ ./perl -Ilib utils/zipdetails
        zipdetails requires 64 bit integers, this Perl has 32 bit integers.
    
    This alone does not make it pass t/porting/utils.t in Perl core, we need
    a corresponding patch to t/porting/utils.t which I will also push.
    demerphq committed Apr 12, 2022
    Configuration menu
    Copy the full SHA
    53b92bf View commit details
    Browse the repository at this point in the history