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: Jaroslav Hajek
Subject: warn when core functions are shadowed
Date: Mon, 1 Feb 2010 10:49:45 +0100

hi all,

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?

-- 
RNDr. Jaroslav Hajek, PhD
computing expert & GNU Octave developer
Aeronautical Research and Test Institute (VZLU)
Prague, Czech Republic
url: www.highegg.matfyz.cz

Attachment: warn_shadow.diff
Description: Text Data


reply via email to

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