develooper Front page | perl.perl5.porters | Postings from August 2001

[ID 20010822.002] h2ph produces files with syntax errors

From:
Robert Helling
Date:
August 22, 2001 05:59
Subject:
[ID 20010822.002] h2ph produces files with syntax errors
Message ID:
200108221215.f7MCFO006573@qft102.physik.hu-berlin.de
This is a bug report for perl from helling@atdotde.de,
generated with the help of perlbug 1.28 running under perl v5.6.0.


-----------------------------------------------------------------
[Please enter your report here]

Hi,

I am just trying to port a script running on my laptop (there it
works, SuSE Linux 6.4 out of the box) to my office PC that has just
been updated to SuSE Linux 7.2. I have a problem with ioctl: If I have
a line 

require 'sys/ioctl.ph'

in my script (same problem for a script with just this line except for
the shebang) I get the following errors:

syntax error at /usr/lib/perl5/site_perl/5.6.0/i586-linux/features.ph line 149, near ") ("
syntax error at /usr/lib/perl5/site_perl/5.6.0/i586-linux/features.ph line 155, near "}"
Compilation failed in require at /usr/lib/perl5/site_perl/5.6.0/i586-linux/sys/ioctl.ph line 5.
Compilation failed in require at ioctltest.pl line 3.

even after running h2ph on the corresponding header files. I put both
features.h and features.ph on a webpage:

http://qft102.physik.hu-berlin.de/~helling/features.h
http://qft102.physik.hu-berlin.de/~helling/features.h

It seems like the offending part is 

(defined(&__GNUC_PREREQ) ? &__GNUC_PREREQ : 0) (2, 7)

which comes from

#if __GNUC_PREREQ (2, 7) && defined __OPTIMIZE__ && !defined __OPTIMIZE_SIZE__
# define __USE_EXTERN_INLINES   1
#endif

To me it seems a better translation would be

(defined(&__GNUC_PREREQ) ? &__GNUC_PREREQ(2, 7) : 0) 

just erasing (2, 7) at least breaks the script.

Robert

[Please do not change anything below this line]
-----------------------------------------------------------------
---
Flags:
    category=utilities
    severity=low
---
Site configuration information for perl v5.6.0:

Configured by root at Mon Jun 18 09:01:54 GMT 2001.

Summary of my perl5 (revision 5.0 version 6 subversion 0) configuration:
  Platform:
    osname=linux, osvers=2.4.3, archname=i586-linux
    uname='linux armstrong 2.4.3 #1 wed may 16 00:37:55 gmt 2001 i686 unknown '
    config_args='-ds -e -Dprefix=/usr -Di_db -Di_dbm -Di_ndbm -Di_gdbm'
    hint=recommended, useposix=true, d_sigaction=define
    usethreads=undef use5005threads=undef useithreads=undef usemultiplicity=undef
    useperlio=undef d_sfio=undef uselargefiles=define 
    use64bitint=undef use64bitall=undef uselongdouble=undef usesocks=undef
  Compiler:
    cc='cc', optimize='-O2 -pipe', gccversion=2.95.3 20010315 (SuSE)
    cppflags='-fno-strict-aliasing -I/usr/local/include'
    ccflags ='-fno-strict-aliasing -I/usr/local/include -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64'
    stdchar='char', d_stdstdio=define, usevfork=false
    intsize=4, longsize=4, ptrsize=4, doublesize=8
    d_longlong=define, longlongsize=8, d_longdbl=define, longdblsize=12
    ivtype='long', ivsize=4, nvtype='double', nvsize=8, Off_t='off_t', lseeksize=8
    alignbytes=4, usemymalloc=n, prototype=define
  Linker and Libraries:
    ld='cc', ldflags =' -L/usr/local/lib'
    libpth=/usr/local/lib /lib /usr/lib
    libs=-lnsl -ldl -lm -lc -lcrypt
    libc=, so=so, useshrplib=false, libperl=libperl.a
  Dynamic Linking:
    dlsrc=dl_dlopen.xs, dlext=so, d_dlsymun=undef, ccdlflags='-rdynamic'
    cccdlflags='-fpic', lddlflags='-shared -L/usr/local/lib'

Locally applied patches:
    

---
@INC for perl v5.6.0:
    /usr/lib/perl5/5.6.0/i586-linux
    /usr/lib/perl5/5.6.0
    /usr/lib/perl5/site_perl/5.6.0/i586-linux
    /usr/lib/perl5/site_perl/5.6.0
    /usr/lib/perl5/site_perl
    .

---
Environment for perl v5.6.0:
    HOME=/home/helling
    LANG=en_US
    LANGUAGE (unset)
    LC_ALL=
    LC_COLLATE=
    LC_CTYPE=
    LC_MESSAGES=
    LC_MONETARY=
    LC_NUMERIC=
    LC_TIME=
    LD_LIBRARY_PATH (unset)
    LOGDIR (unset)
    PATH=/usr/local/bin:/usr/bin:/usr/X11R6/bin:/bin:/usr/games/bin:/usr/games:/opt/gnome/bin:/opt/kde2/bin:/opt/kde/bin:.:/opt/gnome/bin:/opt/gnome/bin:
    PERL_BADLANG (unset)
    SHELL=/bin/tcsh




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