Skip to content

Octave subsref warnings: warning: 'uint64 matrix' object indexed with empty index list #99

@KrisThielemans

Description

@KrisThielemans

#96 reinstated the subsref functions in Swigref.m. However, when running the test-suite with recent Octave, it generates lots of warnings like

warning: 'uint64 matrix' object indexed with empty index list
 warning: called from
  subsref at line 29 column 28

an example is generated at


This turns out to come from the following line in SwigRef.m (generated here)

[varargout{1}] = builtin('subsref',self,substruct('.',s.subs,'()',{}));

It is caused by the empty cell-array for (). The warning can be reproduced as follows

a.x=1;
subsref(a,substruct('.','x','()',{}))

This does returns 1 but with the same warning (but is silent in MATLAB).

The simple solution seems to use

[varargout{1}] = builtin('subsref',self,substruct('.',s.subs));

which has the desired effect

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions