bugGNU Octave - Bugs: bug #36003, misleading error for assignment to...


bug #36003: misleading error for assignment to empty structure

Submitted by:  Ben Abbott <bpabbott>
Submitted on:  Mon 26 Mar 2012 12:12:00 AM UTC  
Category: InterpreterSeverity: 2 - Minor
Priority: 3 - LowItem Group: Feature Request
Status: FixedAssigned to: None
Originator Name: Ben AbbottOpen/Closed: Closed
Release: devOperating System: Any

Add a New Comment(Rich Markup)

You are not logged in

Please log in, so followups can be emailed to you.


(Jump to the original submission Jump to the original submission)

Tue 06 Feb 2018 06:40:04 PM UTC, comment #7:

@Joe: I added you to list of contributors here (http://hg.savannah.gnu.org/hgweb/octave/rev/fa56428a2e91).

Rik <rik5>
Project Administrator
Tue 06 Feb 2018 06:16:18 PM UTC, comment #6:

Thanks @Rik. I didn't know about make check, I'll try to remember to try that next time.
As far as being a contributor, I didn't do a whole lot for this one, but if it counts and isn't too much effort to add then sure I'd be glad to be listed.

Joe Winegarden <wino>
Tue 06 Feb 2018 06:05:41 PM UTC, comment #5:

I checked in the changeset here (http://hg.savannah.gnu.org/hgweb/octave/rev/2ce26c4cb323).

Since this was from a new contributor, I'll document the changes I made to the patch before committing.

1) In order not to violate Matlab copyright I did not copy their error message verbatim. Besides, I still felt it was a little unclear. Instead, I used this,

2) The functions in errwarn.h and errwarn.cc have no logical order so they are listed in alphabetical order as being the least bad organizational principle. I put your new function in to correct alphabetic order in both files.

3) When using 'make check' to run the test suite I discovered that there was now a test failure. The failure was due to the fact that the test was looking specifically for the old error message. I changed the test to match the new message and now the test suite is passing without regressions.

@Joe: If you would like to be listed in the Octave manual as a contributor to Octave just let me know. The list of contributors appears in the preface section of the manual.

Rik <rik5>
Project Administrator
Tue 23 Jan 2018 10:14:43 PM UTC, comment #4:

This is my first contribution so not sure if I did it entirely right, but changeset attached. I'm also unsure if my fix is too naive, i.e. are there conditions under which this is not the right message that need to be distinguished, or how to write a test(s) for it.

Joe Winegarden <wino>
Sat 19 Nov 2016 09:10:46 PM UTC, comment #3:

This is still the same in Octave 4.2.0.

Hartmut <hardy>
Fri 26 Feb 2016 04:55:33 AM UTC, comment #2:

Mike's post seemed to be truncated. The full Matlab error is

(In case the verbatim environment caused the problem, it is: "A dot name structure assignment is illegal when the structure is empty. Use a subscript on the structure.")

Lachlan Andrew <lachlan>
Project Member
Sat 16 May 2015 07:05:54 PM UTC, comment #1:

Confirmed, here is the Matlab error message for reference in case someone wants to add something similar:

Mike Miller <mtmiller>
Project Administrator
Mon 26 Mar 2012 12:12:00 AM UTC, original submission:

This seems to come up a lot on mail-list.

When a subscript is included on the structure, there is no error.

Can something be done to give a more descriptive error message?

Ben Abbott <bpabbott>
Project Member


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

Attach File(s):

Attached Files
file #43041:  36003.cset added by wino (2KiB - application/octet-stream - changeset to fix this bug)


   bug dependencies.

Items that depend on this one: None found


Carbon-Copy List
  • -unavailable- added by rik5 (Posted a comment)
  • -unavailable- added by wino (Updated the item)
  • -unavailable- added by hardy (Posted a comment)
  • -unavailable- added by lachlan (Posted a comment)
  • -unavailable- added by mtmiller (Updated the item)
  • -unavailable- added by bpabbott (Submitted the item)

    Do you think this task is very important?
    If so, you can click here to add your encouragement to it.
    This task has 0 encouragements so far.

    Only project members can vote.


    Please enter the title of George Orwell's famous dystopian book (it's a date):



    Follow 8 latest changes.

    Date Changed By Updated Field Previous Value => Replaced By
    Tue 06 Feb 2018 06:05:41 PM UTCrik5StatusConfirmed=>Fixed
    Tue 23 Jan 2018 10:11:43 PM UTCwinoAttached File-=>Added 36003.cset, #43041
    Sat 16 May 2015 07:05:54 PM UTCmtmillerPriority5 - Normal=>3 - Low
    Tue 28 Jan 2014 04:35:59 AM UTCmtmillerStatusNone=>Duplicate
      Dependencies-=>Depends on bugs #34967
    Mon 26 Mar 2012 12:14:52 AM UTCbpabbottSummarymisleading error message=>misleading error for assignment to empty structure

    Back to the top

    Powered by Savane 3.1-cleanup1