develooper Front page | perl.perl5.porters | Postings from January 2003

[perl #20636] ExtUtils::Constant trying to make empty #defines accessible

Thread Next
From:
perlbug-followup
Date:
January 31, 2003 07:45
Subject:
[perl #20636] ExtUtils::Constant trying to make empty #defines accessible
Message ID:
rt-20636-49962.8.58688674848011@bugs6.perl.org
# New Ticket Created by  tassilo.parseval@post.rwth-aachen.de 
# Please include the string:  [perl #20636]
# in the subject line of all future correspondence about this issue. 
# <URL: http://rt.perl.org/rt2/Ticket/Display.html?id=20636 >



This is a bug report for perl from tassilo.parseval@post.rwth-aachen.de,
generated with the help of perlbug 1.34 running under perl v5.8.0.


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

When creating an extension skeleton using

    h2xs -O -b <version> -n Module::Name header.h

it appears as though ExtUtils::Constant tries to make symbols exportable
that are merely #defined but have no value.

An excerpt from the header I've been using:

    #ifndef __MPLIB_H
    #define __MPLIB_H
    #undef __BEGIN_DECLS
    #undef __END_DECLS
    #ifdef __cplusplus
    # define __BEGIN_DECLS extern "C" {
    # define __END_DECLS }
    #else
    # define __BEGIN_DECLS /* empty */
    # define __END_DECLS /* empty */
    #endif

and from the resulting constant-c.inc:

        case 'L':
          if (memEQ(name, "__END_DECLS", 11)) {
          /*                        ^        */
    #ifdef __END_DECLS
            *iv_return = __END_DECLS;
            return PERL_constant_ISIV;
    #else
            return PERL_constant_NOTDEF;
    #endif
          }
          break;

Running this with 'gcc -E' this is preprocessed into:

        case 'L':
          if (memEQ(name, "__END_DECLS", 11)) {
           

            *iv_return =  ;
            return 3 ;



          }
          break;

and will render the whole project uncompilable:

    In file included from Mplib.xs:9:
    const-c.inc: In function `constant':
    const-c.inc:284: parse error before `;'
    ...

The above problem remains when removing the two offending symbols
(__BEGIN_DECLS and __END_DECLS) from the NAMES-list in
ExtUtils::Constant::WriteConstants() in Makefile.PL.

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

Configured by root at Fri Jul 19 10:50:34 CEST 2002.

Summary of my perl5 (revision 5.0 version 8 subversion 0) configuration:
  Platform:
    osname=linux, osvers=2.4.18, archname=i686-linux
    uname='linux ethan 2.4.18 #1 tue feb 26 09:52:36 cet 2002 i686 unknown '
    config_args=''
    hint=previous, useposix=true, d_sigaction=define
    usethreads=undef use5005threads=undef useithreads=undef usemultiplicity=undef
    useperlio=define d_sfio=undef uselargefiles=define usesocks=undef
    use64bitint=undef use64bitall=undef uselongdouble=undef
    usemymalloc=n, bincompat5005=undef
  Compiler:
    cc='gcc-3.0', ccflags ='-fno-strict-aliasing -I/usr/local/include -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64',
    optimize='-O3',
    cppflags='-fno-strict-aliasing -I/usr/local/include -fno-strict-aliasing -I/usr/local/include -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64'
    ccversion='', gccversion='3.0.4', gccosandvers=''
    intsize=4, longsize=4, ptrsize=4, doublesize=8, byteorder=1234
    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, prototype=define
  Linker and Libraries:
    ld='gcc-3.0', ldflags =' -L/usr/local/lib'
    libpth=/usr/local/lib /lib /usr/lib
    libs=-lnsl -lgdbm -ldbm -ldb -ldl -lm -lc -lcrypt -lutil
    perllibs=-lnsl -ldl -lm -lc -lcrypt -lutil
    libc=/lib/libc-2.2.5.so, so=so, useshrplib=false, libperl=libperl.a
    gnulibc_version='2.2.5'
  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.8.0:
    /usr/opt/lib/perl5/5.8.0/i686-linux
    /usr/opt/lib/perl5/5.8.0
    /usr/opt/lib/perl5/site_perl/5.8.0/i686-linux
    /usr/opt/lib/perl5/site_perl/5.8.0
    /usr/opt/lib/perl5/site_perl
    .

---
Environment for perl v5.8.0:
    HOME=/home/ethan
    LANG=C
    LANGUAGE (unset)
    LC_CTYPE=de_DE@euro
    LD_LIBRARY_PATH=:/usr/local/j2sdk1.4.0/jre/lib/i386:/usr/local/pwlib/lib
    LOGDIR (unset)
    PATH=/usr/local/bin:/usr/bin:/bin:/usr/X11R6/bin:/usr/local/jdk1.3.1/bin:/home/ethan/bin:/usr/games
    PERL_BADLANG (unset)
    SHELL=/bin/bash



Thread Next


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