develooper Front page | perl.perl5.porters | Postings from November 1999

[ID 19991119.002] Suggestion for a new warning

Thread Next
From:
Mike Taylor
Date:
November 19, 1999 07:22
Subject:
[ID 19991119.002] Suggestion for a new warning
Message ID:
E11opqp-0006k4-00@fw-smtp.tecc.co.uk
Apologies for sending this to what I suspect is an inappropriate
address, but would you mind forwarding it for me please?
(And what's the <suggestion-box@perl.org> address?)

My suggestion: I'd like to be able to turn on a warning that lets me
know if my program contains function calls to functions that I haven't
defined.  So for example:

	my $a1 = foo1();
	if ($a1 == 3) {
	    $a1 = foo2();
	}
	print "a1 is $a1\n";

	sub foo1 {
	    return 2;
	}

should report "foo2() not defined" when given the appropriate
options.  (This is a lot like the sort of reporting you get from the
linker when you use Boring Old-Fashioned Languages.)

I appreciate that there is an overhead here, so you'd not want this to
be the default behaviour.  But I think it's trivial to implement
(right?  Just walk the parse-tree before starting the run).  It would
help to ensure that programs that work today don't stop working
tomorrow when someone feeds them input that wanders off down a
different code-path.

Thanks for listening,

	Mike Taylor
	TECC Ltd.
	mike@tecc.co.uk
	Tel. +44 181 880 4040


(Oh, and thanks for Perl -- loving it!)


Thread Next


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About