Hi,
The script:
use Inline C => Config =>
CLEAN_AFTER_BUILD => 1,
BUILD_NOISY => 1;
use Inline C => <<'EOC';
SV * foo(FILE * stream) {
return newSVuv(42);
}
EOC
print foo(*STDOUT);
Running on perl 5.6 I get the following warning during compilation:
try_pl_0446.c: In function `XS_main_foo':
try_pl_0446.c:28: warning: initialization from incompatible pointer ty
+pe
Looking at the C file I see that line 28 is:
FILE * stream = IoIFP(sv_2io(ST(0)));
The same script, run under perl 5.8 produces no compiler warnings. The corresponding line in the C file is:
FILE * stream = PerlIO_findFILE(IoIFP(sv_2io(ST(0))));
(Note that in both instances the C file was autogenerated by
ExtUtils::ParseXS version 2.17.)
Questions:
1) Is there anything I can do to remove that warning with perl 5.6 ?
2) Should I be perturbed by the warning issued with perl 5.6 ?
It's unlikely that the actual demo I've provided is going to suffer from the "incompatible pointer" ... but in the real world, foo() actually *does* something with the
FILE* argument. So far, it all seems to work as intended ... but compiler warnings always worry me ...
Cheers,
Rob
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: |
| & | | & |
| < | | < |
| > | | > |
| [ | | [ |
| ] | | ] |
Link using PerlMonks shortcuts! What shortcuts can I use for linking?
See Writeup Formatting Tips and other pages linked from there for more info.