Perl / perl5

🐪 The Perl programming language
https://dev.perl.org/perl5/
Other
1.9k stars 540 forks source link

h2xs enum bug in ExtUtils::Constant::WriteConstants #8607

Open p5pRT opened 17 years ago

p5pRT commented 17 years ago

Migrated from rt.perl.org#40381 (status was 'open')

Searchable as RT40381$

p5pRT commented 17 years ago

From aaron.dancygier@pipelinefinancial.com

When using h2xs to convert enums there is a macro test failure in

const-c.inc. It seems to be treating enums as if they were #define macros.

I found a blog about this that describes the problems and includes the

appropriate workarounds (hacks)

http​://blogs.sun.com/akolb/entry/pitfals_of_the_perl_xs

It seems ExtUtils​::Constant​::WriteConstants() which

generates const-c.inc is broken.

--Aaron Dancygier

Perl Info ``` Flags: category=utilities severity=medium Site configuration information for perl v5.8.8: Configured by aaron at Fri Sep 1 13:54:47 EDT 2006. Summary of my perl5 (revision 5 version 8 subversion 8) configuration: Platform: osname=linux, osvers=2.4.21-40.elsmp, archname=i686-linux-thread-multi uname='linux engpc22.ny1.corp.exad.net 2.4.21-40.elsmp #1 smp thu feb 2 22:22:39 est 2006 i686 i686 i386 gnulinux ' config_args='' hint=recommended, useposix=true, d_sigaction=define usethreads=define use5005threads=undef useithreads=define usemultiplicity=define useperlio=define d_sfio=undef uselargefiles=define usesocks=undef use64bitint=undef use64bitall=undef uselongdouble=undef usemymalloc=n, bincompat5005=undef Compiler: cc='cc', ccflags ='-D_REENTRANT -D_GNU_SOURCE -DTHREADS_HAVE_PIDS -fno-strict-aliasing -pipe -Wdeclaration-after-statement -I/usr/local/include -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -I/usr/include/gdbm', optimize='-O2', cppflags='-D_REENTRANT -D_GNU_SOURCE -DTHREADS_HAVE_PIDS -fno-strict-aliasing -pipe -Wdeclaration-after-statement -I/usr/local/include -I/usr/include/gdbm' ccversion='', gccversion='3.2.3 20030502 (Red Hat Linux 3.2.3-54)', 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='cc', ldflags =' -L/usr/local/lib' libpth=/usr/local/lib /lib /usr/lib libs=-lnsl -lgdbm -ldb -ldl -lm -lcrypt -lutil -lpthread -lc perllibs=-lnsl -ldl -lm -lcrypt -lutil -lpthread -lc libc=/lib/libc-2.3.2.so, so=so, useshrplib=false, libperl=libperl.a gnulibc_version='2.3.2' Dynamic Linking: dlsrc=dl_dlopen.xs, dlext=so, d_dlsymun=undef, ccdlflags='-Wl,-E' cccdlflags='-fpic', lddlflags='-shared -L/usr/local/lib' Locally applied patches: @INC for perl v5.8.8: /home/aaron/sys/libperl/i686-linux /home/aaron/sys/libperl/site /home/aaron/sys/libperl/site/i686-linux /usr/perl5_8_8//lib/5.8.8/i686-linux-thread-multi /usr/perl5_8_8//lib/5.8.8 /usr/perl5_8_8//lib/site_perl/5.8.8/i686-linux-thread-multi /usr/perl5_8_8//lib/site_perl/5.8.8 /usr/perl5_8_8//lib/site_perl . Environment for perl v5.8.8: HOME=/home/aaron LANG=en_US.UTF-8 LANGUAGE (unset) LD_LIBRARY_PATH=.:/home/aaron/sys/lib LOGDIR (unset) PATH=.:.:/opt/oracle/product/10.2.0/db_1/bin:/usr/kerberos/bin:.:.:/usr/ local/mysql/bin:/usr/local/pgsql/bin:/usr/local/bin:/bin:/usr/bin:/usr/X 11R6/bin:/home/aaron/sys/bin:/usr/local/bin:/usr/sbin:/sbin:/home/aaron/ bin PERLLIB=/home/aaron/sys/libperl/i686-linux:/home/aaron/sys/libperl/site: /home/aaron/sys/libperl/site/i686-linux PERL_BADLANG (unset) SHELL=/bin/bash Disclaimer: Any references to Pipeline performance contained herein are based on historic performance levels which Pipeline expects to maintain or exceed but nevertheless does not guarantee. Congested networks, price volatility, or other extraordinary events may impede future trading activities and degrade performance statistics. ```
p5pRT commented 17 years ago

From @smpeters

On Wed Sep 20 14​:54​:01 2006\, aaron.dancygier@​pipelinefinancial.com wrote​:

This is a bug report for perl from aaron.dancygier@​pipelinefinancial.com\,

generated with the help of perlbug 1.35 running under perl v5.8.8.

-----------------------------------------------------------------

[Please enter your report here]

When using h2xs to convert enums there is a macro test failure in

const-c.inc. It seems to be treating enums as if they were #define macros.

I found a blog about this that describes the problems and includes the

appropriate workarounds (hacks)

http​://blogs.sun.com/akolb/entry/pitfals_of_the_perl_xs

It seems ExtUtils​::Constant​::WriteConstants() which

generates const-c.inc is broken.

Its possible that this problem has been fixed\, as mentioned in RT #25355. Unfortunately\, you've not provided a .h file to test with\, Can you please provide one?

p5pRT commented 17 years ago

The RT System itself - Status changed from 'new' to 'open'

p5pRT commented 17 years ago

From aaron.dancygier@pipelinefinancial.com

I'm including a tarball which tests the included header file. In the bundle is the original makefile and the fixed makefile. I've also added a test file values.t which actually tries to test the values. If you build with the default makefile values.t fails. Replace it with Makefile.PL.fix and rerun make\, make test and it works.

Aaron

-----Original Message----- From​: Steve Peters via RT [mailto​:perlbug-followup@​perl.org] Sent​: Wednesday\, September 20\, 2006 10​:09 PM To​: Aaron Dancygier Subject​: [perl #40381] h2xs enum bug in ExtUtils​::Constant​::WriteConstants

On Wed Sep 20 14​:54​:01 2006\, aaron.dancygier@​pipelinefinancial.com wrote​:

This is a bug report for perl from aaron.dancygier@​pipelinefinancial.com\,

generated with the help of perlbug 1.35 running under perl v5.8.8.

-----------------------------------------------------------------

[Please enter your report here]

When using h2xs to convert enums there is a macro test failure in

const-c.inc. It seems to be treating enums as if they were #define macros.

I found a blog about this that describes the problems and includes the

appropriate workarounds (hacks)

http​://blogs.sun.com/akolb/entry/pitfals_of_the_perl_xs

It seems ExtUtils​::Constant​::WriteConstants() which

generates const-c.inc is broken.

Its possible that this problem has been fixed\, as mentioned in RT #25355. Unfortunately\, you've not provided a .h file to test with\, Can you please provide one?

Disclaimer​: Any references to Pipeline performance contained herein are based on historic performance levels which Pipeline expects to maintain or exceed but nevertheless does not guarantee. Congested networks\, price volatility\, or other extraordinary events may impede future trading activities and degrade performance statistics.

p5pRT commented 17 years ago

From aaron.dancygier@pipelinefinancial.com

h2xsenumtest.h

p5pRT commented 17 years ago

From aaron.dancygier@pipelinefinancial.com

H2xsEnumTest-0.01.tar.gz

p5pRT commented 12 years ago

From @jkeenan

On Wed Sep 20 14​:54​:01 2006\, aaron.dancygier@​pipelinefinancial.com wrote​:

This is a bug report for perl from aaron.dancygier@​pipelinefinancial.com\,

generated with the help of perlbug 1.35 running under perl v5.8.8.

When using h2xs to convert enums there is a macro test failure in

const-c.inc. It seems to be treating enums as if they were #define macros.

I found a blog about this that describes the problems and includes the

appropriate workarounds (hacks)

http​://blogs.sun.com/akolb/entry/pitfals_of_the_perl_xs

Following that link\, I eventually got a 404 error.

Aaron\, do you think you could post more detail about this problem?

Thank you very much. Jim Keenan

p5pRT commented 12 years ago

From @ap

* James E Keenan via RT \perlbug\-followup@​perl\.org [2012-05-27 02​:25]​:

On Wed Sep 20 14​:54​:01 2006\, aaron.dancygier@​pipelinefinancial.com wrote​:

I found a blog about this that describes the problems and includes the appropriate workarounds (hacks)

http​://blogs.sun.com/akolb/entry/pitfals_of_the_perl_xs

Following that link\, I eventually got a 404 error.

Aaron\, do you think you could post more detail about this problem?

http​://web.archive.org/web/20090621113027/http​://blogs.sun.com/akolb/entry/pitfals_of_the_perl_xs