Perl / perl5

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

XS OVERLOAD keyword causes incorrect C code generation #9190

Closed p5pRT closed 16 years ago

p5pRT commented 16 years ago

Migrated from rt.perl.org#49844 (status was 'rejected')

Searchable as RT49844$

p5pRT commented 16 years ago

From @salva

Created by salva@boletus

Using the OVERLOAD keyword in an XS method declarations causes the XS processor to generate bad code that doesn't compile.

For instance\, compiling...

===================================================================== #include "EXTERN.h" #include "perl.h" #include "XSUB.h"

#include "ppport.h"

MODULE = Bug​::XSOverload PACKAGE = Bug​::XSOverload

int op_add(a\, b\, rev)   int a   int b   SV *rev OVERLOAD​: + CODE​:   RETVAL = a + b; OUTPUT​:   RETVAL

reports...

[salva@​boletus​:\~/t/Bug-XSOverload]$ /home/cpantest/perl/5.10.0-thread-multi/bin/perl Makefile.PL Checking if your kit is complete... Looks good Writing Makefile for Bug​::XSOverload [salva@​boletus​:\~/t/Bug-XSOverload]$ make cp lib/Bug/XSOverload.pm blib/lib/Bug/XSOverload.pm /home/cpantest/perl/5.10.0-thread-multi/bin/perl /home/cpantest/perl/5.10.0-thread-multi/lib/5.10.0/ExtUtils/xsubpp -typemap /home/cpantest/perl/5.10.0-thread-multi/lib/5.10.0/ExtUtils/typemap XSOverload.xs > XSOverload.xsc && mv XSOverload.xsc XSOverload.c Please specify prototyping behavior for XSOverload.xs (see perlxs manual) cc -c -I. -fno-strict-aliasing -pipe -I/usr/pkg/include -O -DVERSION=\"\" -DXS_VERSION=\"\" -DPIC -fPIC "-I/home/cpantest/perl/5.10.0-thread-multi/lib/5.10.0/sparc64-netbsd-thread-multi/CORE" XSOverload.c XSOverload.c​: In function 'XS_Bug__XSOverload_nil'​: XSOverload.c​:50​: error​: 'ax' undeclared (first use in this function) XSOverload.c​:50​: error​: (Each undeclared identifier is reported only once XSOverload.c​:50​: error​: for each function it appears in.) XSOverload.c​: In function 'boot_Bug__XSOverload'​: XSOverload.c​:75​: error​: incompatible type for argument 3 of 'Perl_sv_setsv_flags' *** Error code 1

Stop. make​: stopped in /home/salva/t/Bug-XSOverload

(Tested with both 5.8.8 and 5.10.0 with the same result)

Cheers\,

- Salva

Perl Info ``` Flags: category=utilities severity=low Site configuration information for perl 5.10.0: Configured by salva at Mon Jan 14 09:44:49 CET 2008. Summary of my perl5 (revision 5 version 10 subversion 0) configuration: Platform: osname=netbsd, osvers=4.0, archname=sparc64-netbsd-thread-multi uname='netbsd boletus.int.qindel.com 4.0 netbsd 4.0 (sunblade100) #7: thu jan 10 13:15:10 cet 2008 root@boletus.int.qindel.com:usrsrcsysarchsparc64compilesunblade100 sparc64 ' config_args='' hint=recommended, useposix=true, d_sigaction=define useithreads=define, usemultiplicity=define useperlio=define, d_sfio=undef, uselargefiles=define, usesocks=undef use64bitint=define, use64bitall=define, uselongdouble=undef usemymalloc=n, bincompat5005=undef Compiler: cc='cc', ccflags ='-fno-strict-aliasing -pipe -I/usr/pkg/include', optimize='-O', cppflags='-fno-strict-aliasing -pipe -I/usr/pkg/include' ccversion='', gccversion='4.1.2 20061021 prerelease (NetBSD nb3 20061125)', gccosandvers='' intsize=4, longsize=8, ptrsize=8, doublesize=8, byteorder=87654321 d_longlong=define, longlongsize=8, d_longdbl=define, longdblsize=16 ivtype='long', ivsize=8, nvtype='double', nvsize=8, Off_t='off_t', lseeksize=8 alignbytes=8, prototype=define Linker and Libraries: ld='cc', ldflags =' -Wl,-rpath,/usr/pkg/lib -Wl,-rpath,/usr/local/lib -L/usr/pkg/lib' libpth=/usr/pkg/lib /lib /usr/lib libs=-lgdbm -lm -lcrypt -lutil -lc -lposix -lpthread perllibs=-lm -lcrypt -lutil -lc -lposix -lpthread libc=/lib/libc.so, so=so, useshrplib=false, libperl=libperl.a gnulibc_version='' Dynamic Linking: dlsrc=dl_dlopen.xs, dlext=so, d_dlsymun=undef, ccdlflags='-Wl,-E ' cccdlflags='-DPIC -fPIC ', lddlflags='--whole-archive -shared -L/usr/pkg/lib' Locally applied patches: @INC for perl 5.10.0: /home/cpantest/perl/5.10.0-thread-multi/lib/5.10.0/sparc64-netbsd-thread-multi /home/cpantest/perl/5.10.0-thread-multi/lib/5.10.0 /home/cpantest/perl/5.10.0-thread-multi//lib/site_perl/5.10.0/sparc64-netbsd-thread-multi /home/cpantest/perl/5.10.0-thread-multi//lib/site_perl/5.10.0 . Environment for perl 5.10.0: HOME=/home/salva LANG (unset) LANGUAGE (unset) LD_LIBRARY_PATH (unset) LOGDIR (unset) PATH=/home/salva/bin:/bin:/sbin:/usr/bin:/usr/sbin:/usr/X11R6/bin:/usr/pkg/bin:/usr/pkg/sbin:/usr/games:/usr/local/bin:/usr/local/sbin:/usr/local/subversion/bin PERL_BADLANG (unset) SHELL=/usr/pkg/bin/bash ____________________________________________________________________________________ Be a better friend, newshound, and know-it-all with Yahoo! Mobile. Try it now. http://mobile.yahoo.com/;_ylt=Ahu06i62sR8HDtDypao8Wcj9tAcJ ```
p5pRT commented 16 years ago

From @salva

Bug-XSOverload-.tar.gz

p5pRT commented 16 years ago

From kaffeetisch@gmx.de

On Wed\, 2008-01-16 at 08​:46 -0800\, Salvador Fandiño wrote​:

Using the OVERLOAD keyword in an XS method declarations causes the XS processor to generate bad code that doesn't compile.

That's been reported to ExtUtils​::ParseXS' bug queue already\, but hasn't received a response yet​: \<http​://rt.cpan.org/Public/Bug/Display.html?id=31533>

-- Bye\, -Torsten

p5pRT commented 16 years ago

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

p5pRT commented 16 years ago

p5p@spam.wizbit.be - Status changed from 'open' to 'rejected'