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

[ID 19991119.002] Suggestion for a new warning

Thread Next
Mike Taylor
November 19, 1999 07:22
[ID 19991119.002] Suggestion for a new warning
Message ID:
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 <> 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.
	Tel. +44 181 880 4040

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

Thread Next Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at | Group listing | About