develooper Front page | perl.perl5.porters | Postings from February 2001

5.6.0 bug involving proto'd functions calling themselves

Jeff Pinyan
February 28, 2001 06:17
5.6.0 bug involving proto'd functions calling themselves
Message ID:
On Feb 22, Andrew Hamm said:

>    main::rec() called too early to check prototype at rec line 9.
>#!/usr/bin/perl -w
>use strict;
>## sub rec($);
>sub rec($) {
>    my $i = shift;
>    print "$i\n";
>    rec($i + 1) if $i < 3;
>If you uncomment the forward declaration at line 4, the warning message goes
>away. I don't think that's right. Opinions please?

The function prototype is not registered until the function is finished
being compiled.  However, in the process of compiling the function, the
opcode for calling that same function is found.

It seems silly, though.  I shall forward this report to P5P.

Jeff "japhy" Pinyan
CPAN - #1 Perl Resource  (my id:  PINYAN)
PerlMonks - An Online Perl Community
The Perl Archive - Articles, Forums, etc. Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at | Group listing | About