Package: abi-compliance-checker
Version: 2.3-0.2
Severity: normal

I've noticed this message repeatedly appearing in the ci.debian.net logs:

Can't "next" outside a loop block at /usr/bin/abi-compliance-checker line 10171.

That's the "next" in this function:

sub exec_helper(@)
{
    my ($reader, $writer) = @_;
    do {
        chomp($line = <$reader>);
        next if (!$line);
        if ($line eq 'exit') {
            exit(0);    
        }
        system($line);
        print $writer "$? $!\n";
    } while(1);
}

This is a quirk of Perl - "next" doesn't work in a "do { ... } while"
like "continue" in C/C++ does because it's really a "do { ... }" block
with a while applied.

"perldoc perlsyn" suggests just doubling the braces on the loop, but in
this case a clearer fix (untested) is probably to rewrite the loop in
the form: "while(1) { ... }"

The actual current effect of "next" here seems to be to terminate the
loop.  That seems problematic on the face of it, but in practice I
think the only cases where it would trigger are an entirely empty line or
"0" with no newline, both of which would mean the end of the input
stream.

But maybe the loop should terminate at the end of the input stream,
since otherwise it seems this loop will never terminate if the stream
ends without "exit" being received.  So perhaps the better fix is:

        if (!$line || $line eq 'exit) {
            exit(0);
        }

Cheers,
    Olly

Reply via email to