Bug in the if test
Jaroslav Hajek
highegg at gmail.com
Mon Aug 18 03:11:57 CDT 2008
On Tue, Aug 12, 2008 at 11:07 AM, Zdenek Wagner
<wagner at hroch486.icpf.cas.cz> wrote:
> To: bug at octave.org
> Cc: zdenek.wagner at gmail.com
> Subject: Bug in the if test
>
> Bug report for Octave 3.0.1 configured for i386-redhat-linux-gnu
>
> Description:
> -----------
>
> * I have the following code in order to make the same program work in several
> versions of Octave:
>
> if exist("save_precision") == 5
> oldprec = save_precision(newprec);
> else
> oldprec = save_precision;
> save_precision = newprec;
> endif
>
> Yet Octave emits warning that save_precision is no longer a builtin variable
> although exist("save_precision") does return 5.
>
> Repeat-By:
> ---------
>
> The code is inside a function written by me. The bug occurs both when called
> interactivelly and when invoked from a script started by
> octave -qH script.m
>
> Fix:
> ---
>
Currently, the check is made at parse time. The attached patch
postpones it until first actual execution of the statement (but only
warns once).
cheers,
--
RNDr. Jaroslav Hajek
computing expert
Aeronautical Research and Test Institute (VZLU)
Prague, Czech Republic
url: www.highegg.matfyz.cz
-------------- next part --------------
A non-text attachment was scrubbed...
Name: assign-obsolete-chk.diff
Type: text/x-diff
Size: 3137 bytes
Desc: not available
Url : https://www.cae.wisc.edu/pipermail/bug-octave/attachments/20080818/a394ed9b/attachment.bin
More information about the Bug-octave
mailing list