This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
regen/embed.pl: Add sanity test for entries
authorKarl Williamson <public@khwilliamson.com>
Thu, 27 Dec 2012 16:55:54 +0000 (09:55 -0700)
committerKarl Williamson <public@khwilliamson.com>
Fri, 28 Dec 2012 17:38:53 +0000 (10:38 -0700)
A void returning function should not be required to have its return
value tested.

regen/embed.pl

index b46f615..cbf421f 100755 (executable)
@@ -76,6 +76,9 @@ my ($embed, $core, $ext, $api) = setup_embed();
        my @names_of_nn;
        my $func;
 
+       if (! $can_ignore && $retval eq 'void') {
+           warn "It is nonsensical to require the return value of a void function ($plain_func) to be checked";
+       }
        my $splint_flags = "";
        if ( $SPLINT && !$commented_out ) {
            $splint_flags .= '/*@noreturn@*/ ' if $never_returns;