I had the word static in the declaration of a function, but not in its subsequent definition

With Inline::C, function declarations are usually unnecessary. I wouldn't go so far as to say that they're *never* needed, but I've not yet struck a situation where they're required.

with the static keyword on a separate line

It's a bug that having 'static' on a separate line is producing different behaviour. In fact, I think it's a bug in the Parse::RecDescent parsing of the code - if you parse with ParseRegExp the problem disappears. ParseRegExp is a much faster parser, too. You use it by specifying the Inline config option USING => 'ParseRegExp',
(ParseRegExp is broken in Inline-0.44, but works fine for me in Inline-0.45.)

I'm not sure if it's a bug or a feature that the static keyword makes the function invisible from perl, but that's certainly the way it is for me. I'm still a little bit puzzled that you needed to use static to get the desired effect. I've written plenty of Inline::C functions that are uncallable from Perl, and haven't had to do anything like that. Of course, if I call them from Perl, then I get a runtime error straight away - and they do have to be defined in the script *before* any of the other Inline::C functions that call them.

Anyway, good that you got it working - and I much appreciate your feedback.

Cheers,
Rob

In reply to Re^2: weird XS_unpack_charPtrPtr error by syphilis
in thread weird XS_unpack_charPtrPtr error by tlm

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.