Skip Menu |
 

This queue is for tickets about the Devel-CheckLib CPAN distribution.

Report information
The Basics
Id: 66717
Status: new
Priority: 0/
Queue: Devel-CheckLib

People
Owner: Nobody in particular
Requestors: chm [...] cpan.org
Cc:
AdminCc:

Bug Information
Severity: Critical
Broken in: 0.92
Fixed in: (no value)



Subject: alternate main body doesn't work without lib argument
MIME-Version: 1.0
X-Mailer: MIME-tools 5.427 (Entity 5.427)
X-RT-Original-Encoding: utf-8
Content-Type: multipart/mixed; boundary="----------=_1300476069-26834-240"
Content-Length: 0
Content-Type: text/html; charset="UTF-8"
Content-Disposition: inline
Content-Transfer-Encoding: binary
Content-Length: 2004
If you check for the availability of  a function of feature without
giving a library argument, function argument is never actually
used in a trial compile and a failure is not reported:

$ less checklib-test.pl
use Devel::CheckLib;

my $function = 'bogus();';
my $header = 'math.h';
my $library = ['m'];

$status = check_lib(function=>$function);
print "check_lib(function=>$function) got " . ($status?1:0) . "\n";

$status = check_lib(header=>$header,function=>$function);
print "check_lib(header=>'$header',function=>'$function') got " . ($status?1:0) . "\n";

$status = check_lib(lib=>$library,function=>$function);
print "check_lib(lib=>['@$library'],function=>'$function') got " . ($status?1:0) . "\n";

$status = check_lib(lib=>$library,header=>$header,function=>$function);
print "check_lib(lib=>['@$library'],header=>'$header',function=>'$function') got " . ($status?1:0) . "\n";

$ ./checklib-test.pl
check_lib(function=>bogus();) got 1
check_lib(header=>'math.h',function=>'bogus();') got 1
check_lib(lib=>['m'],function=>'bogus();') got 0
check_lib(lib=>['m'],header=>'math.h',function=>'bogus();') got 0

I would say this is more of a feature request except for the
silent failure.  One possible fix would be to disallow this mode
(which would make it inconvenient to test for existing functionality
in the default library and header search paths).

A better would be to add a null library check if a function is
specified and no libraries were passed to check.  A workaround
the problem is to add a library that you know will be there
(tricky but maybe -lm will work).




Subject: checklib-test.pl
MIME-Version: 1.0
Content-Type: application/octet-stream; name="checklib-test.pl"
X-Mailer: MIME-tools 5.427 (Entity 5.427)
Content-Disposition: inline; filename="checklib-test.pl"
Content-Transfer-Encoding: base64
Content-Length: 693
Download checklib-test.pl
text/x-perl 693b
#!/usr/bin/perl use Devel::CheckLib; my $function = 'bogus();'; my $header = 'math.h'; my $library = ['m']; $status = check_lib(function=>$function); print "check_lib(function=>$function) got " . ($status?1:0) . "\n"; $status = check_lib(header=>$header,function=>$function); print "check_lib(header=>'$header',function=>'$function') got " . ($status?1:0) . "\n"; $status = check_lib(lib=>$library,function=>$function); print "check_lib(lib=>['@$library'],function=>'$function') got " . ($status?1:0) . "\n"; $status = check_lib(lib=>$library,header=>$header,function=>$function); print "check_lib(lib=>['@$library'],header=>'$header',function=>'$function') got " . ($status?1:0) . "\n";


This service is sponsored and maintained by Best Practical Solutions and runs on Perl.org infrastructure.

Please report any issues with rt.cpan.org to rt-cpan-admin@bestpractical.com.