NAME

XS::Check - check XS for problems

SYNOPSIS

use XS::Check;
my $check = XS::Check->new ();
$check->check_file ('some.xs');

VERSION

This documents version 0.03 of XS::Check corresponding to git commit 12dbc663708ada0056c58f45fd7dc26bbf92378e released on Tue Aug 22 07:05:08 2017 +0900.

DESCRIPTION

Check XS files for errors.

METHODS

new

my $check = XS::Check->new ();

check

$check->check ($xs);

See "SUGGESTIONS" for what this reports.

check_file

$check->check ($xs_file);

Convenience method to read in $xs_file then run "check" on it.

This assumes UTF-8 encoding of $xs_file.

SUGGESTIONS

This section details the possible suggestions made by the module and the motivations behind them.

Use STRLEN in SvPV

Using an int type for the second argument to SvPV may cause errors on 64-bit Perls.

Use const char * for return value of SvPV

Be careful to not overwrite Perl's own buffer, which SvPV returns.

Don't use malloc/calloc/realloc/free

Replace with Newx etc.

These cause "free to wrong pool" errors on multithreaded Windows Perls.

DEPENDENCIES

C::Tokenize

This supplies the regular expressions used to parse C by the module.

"read_text" in File::Slurper

This is used by "check_file".

Text::LineNumber

This is used to get the line numbers.

Carp

SEE ALSO

Perl XS modules and CPAN testers

A collection of more or less obscure bugs found by CPAN testers, the original inspiration for this module.

AUTHOR

Ben Bullock, <bkb@cpan.org>

COPYRIGHT & LICENCE

This package and associated files are copyright (C) 2017 Ben Bullock.

You can use, copy, modify and redistribute this package and associated files under the Perl Artistic Licence or the GNU General Public Licence.