Skip Menu |

Preferred bug tracker

Please visit the preferred bug tracker to report your issue.

This queue is for tickets about the ExtUtils-ParseXS CPAN distribution.

Report information
The Basics
Id: 30673
Status: resolved
Priority: 0/
Queue: ExtUtils-ParseXS

People
Owner: Nobody in particular
Requestors: hjp [...] hjp.at
Cc:
AdminCc:

Bug Information
Severity: Normal
Broken in: 2.18
Fixed in: (no value)



[Note: I originally reported this as a bug against perl 5.8.8. (See http://rt.perl.org/rt3/Public/Bug/Display.html?id=46431), but have been advised that the XS stuff has been removed from the core (so that's why I didn't find it in the 5.9.x source :-)). I have checked that the bug is still present in Extutils-ParseXS 2.18, but the problematic line is now in ParseXS.pm (around 1117) instead of xsubpp] Consider the following XS code: void judy1_thaw(unsigned long set, char *str, unsigned long length(str)) CODE: Pvoid_t s1 = (Pvoid_t)set; This gets translated into into: XS(XS_Bit__Vector__Judy_judy1_thaw); /* prototype to pass -Wmissing-prototypes */ XS(XS_Bit__Vector__Judy_judy1_thaw) { dXSARGS; if (items != 2) Perl_croak(aTHX_ "Usage: Bit::Vector::Judy::judy1_thaw(set, str)"); PERL_UNUSED_VAR(cv); /* -W */ { STRLEN STRLEN_length_of_str; unsigned long XSauto_length_of_str; unsigned long set = (unsigned long)SvUV(ST(0)); char * str = (char *)SvPV(ST(1), STRLEN_length_of_str); XSauto_length_of_str = STRLEN_length_of_str;#line 361 "Judy.xs" Pvoid_t s1 = (Pvoid_t)set; The preprocessor directive '#line 361 "Judy.xs"' gets tacked at the end of the previous line, which gcc doesn't like: Judy.c: In function ‘XS_Bit__Vector__Judy_judy1_thaw’: Judy.c:599: error: stray ‘#’ in program Adding a newline fixes the problem: --- lib/ExtUtils/xsubpp.orig 2005-04-21 18:03:46.000000000 +0200 +++ lib/ExtUtils/xsubpp 2007-10-14 21:45:36.000000000 +0200 @@ -430,7 +430,7 @@ print "\tSTRLEN\tSTRLEN_length_of_$2;\n"; $lengthof{$2} = $name; # $islengthof{$name} = $1; - $deferred .= "\n\tXSauto_length_of_$2 = STRLEN_length_of_$2;"; + $deferred .= "\n\tXSauto_length_of_$2 = STRLEN_length_of_$2;\n"; } # check for optional initialisation code
From: hjp [...] hjp.at
On Mon Nov 12 11:55:39 2007, hjp@hjp.at wrote: Show quoted text
> [Note: I originally reported this as a bug against perl 5.8.8. (See > http://rt.perl.org/rt3/Public/Bug/Display.html?id=46431), but have been > advised that the XS stuff has been removed from the core (so that's why > I didn't find it in the 5.9.x source :-)). I have checked that the bug > is still present in Extutils-ParseXS 2.18, but the problematic line is > now in ParseXS.pm (around 1117) instead of xsubpp]
Here's a patch against Extutils-ParseXS 2.18.
--- lib/ExtUtils/ParseXS.pm.orig 2007-01-30 03:56:14.000000000 +0100 +++ lib/ExtUtils/ParseXS.pm 2007-11-12 17:56:25.000000000 +0100 @@ -1114,7 +1114,7 @@ print "\tSTRLEN\tSTRLEN_length_of_$2;\n"; $lengthof{$2} = $name; # $islengthof{$name} = $1; - $deferred .= "\n\tXSauto_length_of_$2 = STRLEN_length_of_$2;"; + $deferred .= "\n\tXSauto_length_of_$2 = STRLEN_length_of_$2;\n"; } # check for optional initialisation code
Patch applied to repository trunk
For the record, this has been released and can be closed. --Steffen