octave-maintainers
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

warn when core functions are shadowed


From: John W. Eaton
Subject: warn when core functions are shadowed
Date: Mon, 1 Feb 2010 09:56:35 -0500

On  1-Feb-2010, Jaroslav Hajek wrote:

| attached is a patch that enables Octave to issue a warning when core
| library or built-in functions are shadowed by user functions after
| addpath ().
| This may help users avoid unexpected failures (and subsequent false
| bug reports) caused by name clashes from their own functions or
| functions from packages (primarily old versions of packages that
| sometimes contains functions subsequently implemented or moved to
| core. This has bitten me more than once.)
| 
| So now we'll see warnings like this:
| 
| warning: function ./accumarray.m shadows a core library function
| warning: function /home/hajek/octave/nth_element.m shadows a built-in function
| 
| Enabling the warning also for files from "." was a bit tricky, because
| the "." directory was being treated in a complicated way, added
| multiple times.
| I modified things a bit, hope I didn't screw anything up.
| 
| Currently the warning is hard-wired. Should it be configurable?
| Note that to test the patch you need to install the built binary,
| because run-octave adds the system path through command line params.
| 
| Comments? OK to push?

Seems fine to me, so I think it is OK to push.

Thanks,

jwe


reply via email to

[Prev in Thread] Current Thread [Next in Thread]