[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Octave-bug-tracker] [bug #42651] Incorrect input validation for strings
From: |
Rik |
Subject: |
[Octave-bug-tracker] [bug #42651] Incorrect input validation for strings |
Date: |
Mon, 30 Jun 2014 21:39:35 +0000 |
User-agent: |
Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:30.0) Gecko/20100101 Firefox/30.0 |
Follow-up Comment #4, bug #42651 (project octave):
The 'sq_string' might be because we want to mimic Matlab, but I don't really
know.
For sort, I think we should be checking that the second argument is either a
numeric scalar (DIM to sort on) or is a string (MODE). It doesn't need to
match the type of the first operand which might be numeric, string, or
cellstr. I know I'm repeating myself, but the option string for a function
really should be a string, but doesn't have to have any relationship to what
kind of input the function itself acts on. Given that mixed char/numeric
concatenation is promoted to character class by the interpreter people could
still have strange obtuse code without generating an error message.
sort (..., ["ascen" 100])
And yes, something is very wrong with the num-to-str warning. The warning is
"on" in 3.2.4 - 4.1.X but the test code from warning_ids() doesn't produce a
warning.
[ "f", 111, 111 ]
I think that deserves it's own bug report. Interestingly, the warning going
the other way does work.
warning ('on', 'Octave:str-to-num')
'abc' + 0
warning: implicit conversion from string to real N-d array
ans =
97 98 99
_______________________________________________________
Reply to this item at:
<http://savannah.gnu.org/bugs/?42651>
_______________________________________________
Message sent via/by Savannah
http://savannah.gnu.org/