bugGNU Octave - Bugs: bug #55210, isvarname does not check length of...

 
 

bug #55210: isvarname does not check length of string against Matlab namelengthmax()

Submitter:  Rik <rik5>
Submitted:  Tue 11 Dec 2018 11:43:35 PM UTC
   
 
Category:  Octave Function Severity:  2 - Minor
Priority:  2 Item Group:  Matlab Compatibility
Status:  Confirmed Assigned to:  None
Originator Name:  Open/Closed:  * Open
Release:  * dev Operating System:  * Any
Fixed Release:  None Planned Release:  None
* Mandatory Fields

Add a New Comment Rich Markup
   

Sat 28 Dec 2019 12:10:12 AM UTC, comment #2: 

I think the issue with namelengthmax is related, but separate.  Regardless of the value returned by namelengthmax(), it is never checked in isvarname().

Rik <rik5>
Group administrator
Fri 27 Dec 2019 09:12:14 PM UTC, comment #1: 

Why should Octave's namelengthmax function return 63?  It seems to me that Matlab code that uses namelengthmax in Octave should not be limited to 63 characters just because matlab has that limit.  Instead, I think we should have namelengthmax return the real limit in Octave.  Or is that a problem because there is code that does something like


myvars = char (n, namelengthmax);


and then copies variable names into the array?  If so, then I think we should just ignore namelengthmax inside isvarname and close this report as "won't fix".

John W. Eaton <jwe>
Group administrator
Tue 11 Dec 2018 11:43:35 PM UTC, original submission:  

The Matlab version of isvarname checks that the input string is less than namelengthmax, or it returns false.

Octave implements the function namelengthmax, but internally we do not see any reason to limit programmers.  Accordingly, we allow Inf length strings (well, really as much as an octave_idx_type will hold which is a minimum of 2^31-1).

I still don't see that we need to limit programmers, but this is a difference between the Matlab and Octave versions of this function.

Rik <rik5>
Group administrator

 

(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

Attach Files:
   
   
Comment:
   

No files currently attached

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -email is unavailable- added by jwe (Posted a comment)
  • -email is unavailable- added by rik5 (Submitted the item)
  •  

    There are 0 votes so far. Votes easily highlight which items people would like to see resolved in priority, independently of the priority of the item set by tracker managers.

    Only group members can vote.

     

    Follow 2 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2018-12-11 rik5 Priority3 - Low 2
    2018-12-11 rik5 Priority5 - Normal 3 - Low

    Back to the top

    Powered by Savane 3.13-d3ae.
    Corresponding source code