develooper Front page | perl.perl5.porters | Postings from April 2010

[perl #74614] [PATCH] h2ph produces incorrect code in preamble

Robin Barker
April 24, 2010 01:26
[perl #74614] [PATCH] h2ph produces incorrect code in preamble
Message ID:
# New Ticket Created by  Robin Barker 
# Please include the string:  [perl #74614]
# in the subject line of all future correspondence about this issue. 
# <URL: >

This is a bug report for perl from
generated with the help of perlbug 1.39 running under perl 5.13.0.

[Please describe your issue here]

The h2ph utility produces non-compiling code in its preamble,
generated by build_preamble_if_necessary().  If one of the
build-in macros has arguments; e.g. __INT64_C(c) produces

unless (defined &__INT64_C(c)) { sub __INT64_C(c)() { &cLL } }

(note double prototype).  The preamble also contains "&int"
because it thinks "int" is a macro not a type. 
These issues produce warnings but this is hidden by the test
suite because there is an error in lib/h2ph.t.

The patch fixes h2ph.PL to produce compiling code and fixes
h2ph.t to properly trap warnings or failures to compile.

(Perhaps severity should be "low" because I guess no one is 
using h2ph, otherwise this would have been spotted earlier.)
[Please do not change anything below this line]
Site configuration information for perl 5.13.0:

Configured by robin at Thu Apr 22 12:22:28 BST 2010.

Summary of my perl5 (revision 5 version 13 subversion 0) configuration:
  Commit id: 4fd8f0cd61ad36e90cd5082dffa22afb90dcc58f
    osname=linux, osvers=2.6.31-20-generic, archname=i686-linux-64int
    uname='linux spade-ubuntu 2.6.31-20-generic #58-ubuntu smp fri mar 12 05:23:09 utc 2010 i686 gnulinux '
    config_args='-des -Dcc=gcc -Duse64bitint -Doptimize=-O2 -g -Dusedevel -Dman3dir=none'
    hint=recommended, useposix=true, d_sigaction=define
    useithreads=undef, usemultiplicity=undef
    useperlio=define, d_sfio=undef, uselargefiles=define, usesocks=undef
    use64bitint=define, use64bitall=undef, uselongdouble=undef
    usemymalloc=n, bincompat5005=undef
    cc='gcc', ccflags ='-DDEBUGGING -fno-strict-aliasing -pipe -fstack-protector -I/usr/local/include -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64',
    optimize='-O2 -g',
    cppflags='-DDEBUGGING -fno-strict-aliasing -pipe -fstack-protector -I/usr/local/include'
    ccversion='', gccversion='4.5.0', 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='gcc', ldflags =' -fstack-protector -L/usr/local/lib'
    libpth=/usr/local/lib /lib /usr/lib /usr/lib64
    libs=-lnsl -ldl -lm -lcrypt -lutil -lc
    perllibs=-lnsl -ldl -lm -lcrypt -lutil -lc
    libc=/lib/, so=so, useshrplib=false, libperl=libperl.a
  Dynamic Linking:
    dlsrc=dl_dlopen.xs, dlext=so, d_dlsymun=undef, ccdlflags='-Wl,-E'
    cccdlflags='-fPIC', lddlflags='-shared -O2 -g -L/usr/local/lib -fstack-protector'

Locally applied patches:

@INC for perl 5.13.0:

Environment for perl 5.13.0:
    LANGUAGE (unset)
    LOGDIR (unset)
    PERL_BADLANG (unset)
    SHELL=/bin/tcsh Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at | Group listing | About