develooper Front page | perl.perl5.porters | Postings from December 2018

[perl #133654] xsubpp OUTLIST and PROTOTYPES conflict

From:
Tony Cook via RT
Date:
December 5, 2018 04:56
Subject:
[perl #133654] xsubpp OUTLIST and PROTOTYPES conflict
Message ID:
rt-4.0.24-7717-1543985760-886.133654-15-0@perl.org
On Mon, 12 Nov 2018 02:57:51 -0800, ailin@devio.us wrote:
> xsubpp generates code that cannot be used from Perl, if prototypes are
> used together with an OUTLIST parameter. See the following example
> code:
> 
> #define PERL_NO_GET_CONTEXT
> 
> MODULE = Test  PACKAGE = Test
> PROTOTYPES: ENABLE
> 
> int
> s_c_f_w(str, width, OUTLIST bytes)
>     char *str
>     unsigned int width
>     unsigned int bytes
> C_ARGS:
>     str, width, &bytes
> 
> If compiled, results in:
> 
> $ xsubpp Test.xs
> 
> XS_EUPXS(XS_Test_s_c_f_w); /* prototype to pass -Wmissing-prototypes
> */
> XS_EUPXS(XS_Test_s_c_f_w)
> {
>     dVAR; dXSARGS;
>     if (items != 2)
>        croak_xs_usage(cv,  "str, width");
>     {
>        ...
> 
> (void)newXSproto_portable("Test::s_c_f_w", XS_Test_s_c_f_w, file,
> "$$$");
> ...
> 
> The prototype is set as `$$$' but the items is checked for being
> 2. Note, the items check is correct and the prototype should be `$$'.

This should be fixed by 028027e3fb6bba4f720b334e63e26f97a49cf6be.

Tony

---
via perlbug:  queue: perl5 status: new
https://rt.perl.org/Ticket/Display.html?id=133654



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