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

5.005_03 h2ph.PL can generate syntactically incorrect #70

p5pRT opened this issue Jun 15, 1999 · 1 comment

5.005_03 h2ph.PL can generate syntactically incorrect #70

p5pRT opened this issue Jun 15, 1999 · 1 comment


Copy link

p5pRT commented Jun 15, 1999

Migrated from (status was 'resolved')

Searchable as RT872$

Copy link

p5pRT commented Jun 15, 1999


The h2ph included with 5.00503 will autogenerate, and the
file it creates is then explicitly required by each and every *.ph
file subsequently generated.

Unfortunately, the file is not necessarily syntactically correct​:

Warning​: Use of "defined" without parens is ambiguous at /usr/tools/lib/perl5/ line 2.
Can't use subscript on subroutine entry at /usr/tools/lib/perl5/ line 2, near "} }"
(Did you mean $ or @​ instead of &?)
syntax error at /usr/tools/lib/perl5/ line 4, near "unless"

The offensive line is​:

unless (defined &) { sub () { "" } }

This causes modules such as Sys​::Syslog, which requires, to
fail at compile time. This is bad...

The problem is caused by the _extract_cc_defines() subroutine, which
parses the values found in 3 %Config values, but doesn't deal with
empty values correctly.

In my case, building with SunProC 4.2 on Solaris 2.5.1,
$Config{ccsymbols} is empty, and this results in the null key, and the
bogus, and thus the very unhappy users.

BTW, the test suite doesn't catch this, as it compares the resulting
test of an h2ph invocation, but doesn't require the code to verify
that it is syntactically correct.

The h2ph.PL patch is exceedingly trivial (sorry, no time to hack the
test suite today).

*** h2ph.PL.orig Tue Jun 15 16​:30​:52 1999
--- h2ph.PL Tue Jun 15 16​:31​:21 1999
*** 576,582 ****
  # Split compiler pre-definitions into `key=value' pairs​:
  foreach (split /\s+/, $allsymbols) {
! /(.*?)=(.*)/;
  $define{$1} = $2;
  if ($opt_D) {
--- 576,582 ----
  # Split compiler pre-definitions into `key=value' pairs​:
  foreach (split /\s+/, $allsymbols) {
! next unless /(.*?)=(.*)/;
  $define{$1} = $2;
  if ($opt_D) {

This perlbug was built using Perl 5.00503 - Thu May 20 11​:43​:00 EDT 1999
It is being executed now by Perl 5.00503 - Thu May 20 11​:45​:48 EDT 1999.

Site configuration information for perl 5.00503​:

Configured by wpm at Thu May 20 11​:45​:48 EDT 1999.

Summary of my perl5 (5.0 patchlevel 5 subversion 3) configuration​:
  osname=solaris, osvers=2.5.1, archname=sun4-solaris
  uname='sunos sascs1 5.5.1 generic_103640-24 sun4u sparc sunw,ultra-enterprise '
  hint=recommended, useposix=true, d_sigaction=define
  usethreads=undef useperlio=undef d_sfio=undef
  cc='cc', optimize='-O', gccversion=
  cppflags='-DAPPLLIB_EXP="/ms/dist/perl5/VERS/5.00503-core/lib/perl5​:/ms/dist/perl5/VERS/5.005-core/lib/perl5" -I/usr/local/include'
  ccflags ='-DAPPLLIB_EXP="/ms/dist/perl5/VERS/5.00503-core/lib/perl5​:/ms/dist/perl5/VERS/5.005-core/lib/perl5" -I/usr/local/include'
  stdchar='unsigned char', d_stdstdio=define, usevfork=false
  intsize=4, longsize=4, ptrsize=4, doublesize=8
  d_longlong=define, longlongsize=8, d_longdbl=define, longdblsize=16
  alignbytes=8, usemymalloc=n, prototype=define
  Linker and Libraries​:
  ld='cc', ldflags =' -L/usr/local/lib'
  libpth=/usr/local/lib /lib /usr/lib /usr/ccs/lib
  libs=-lsocket -lnsl -ldb -ldl -lm -lc -lcrypt
  libc=/lib/, so=so, useshrplib=false, libperl=libperl.a
  Dynamic Linking​:
  dlsrc=dl_dlopen.xs, dlext=so, d_dlsymun=undef, ccdlflags=' '
  cccdlflags='-KPIC', lddlflags='-G -L/usr/local/lib'

Locally applied patches​:

@​INC for perl 5.00503​:

Environment for perl 5.00503​:
  LANG (unset)
  LANGUAGE (unset)
  LOGDIR (unset)
  PERL_BADLANG (unset)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
None yet

No branches or pull requests

1 participant