Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
KrisThielemans opened this issue Dec 29, 2021 · 0 comments

Comments

@KrisThielemans
Copy link

#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

KrisThielemans added a commit to KrisThielemans/swig that referenced this issue Dec 30, 2021
SwigRef.subsref used an empty () index, generating warnings with
recent Octave. This was superfluous so I've removed it.

Fixes jaeandersson#99
@KrisThielemans KrisThielemans mentioned this issue Dec 30, 2021
9 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant