bugGNU Octave - Bugs: bug #44336, warning ("error",...


bug #44336: warning ("error", "all") changes "matlab-compatible" warnings if there's an "all" status before

Submitted by:  Carnë Draug <carandraug>
Submitted on:  Sat 21 Feb 2015 05:00:24 PM UTC  
Category:  Interpreter Severity:  2 - Minor
Priority:  5 - Normal Item Group:  None
Status:  Fixed Assigned to:  Lachlan Andrew <lachlan>
Originator Name:  Open/Closed:  Closed
Release:  dev Operating 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)

Mon 08 Aug 2016 09:46:24 PM UTC, comment #6: 

@Lachlan: I pushed your patch here (http://hg.savannah.gnu.org/hgweb/octave/rev/cf18d6e791a1).  Closing report and marking as fixed on http://wiki.octave.org/Bug_Fix_List_-_4.2.0_Release.

Rik <rik5>
Project Administrator
Fri 26 Feb 2016 09:43:46 AM UTC, comment #5: 

I forgot to mention in the previous post that a fix is attached, and also to give the example showing that "warning on all" is not required.

Without the patch:

>> warning on Octave:language-extension
>> a=1;
>> a++
warning: Octave language extension used: ++ used as operator
ans =  1
>> warning error all
>> a++
error: Octave language extension used: ++ used as operator
error: parse error

Lachlan Andrew <lachlan>In charge of this item.
Thu 11 Feb 2016 10:15:44 AM UTC, comment #4: 

It turns out that there doesn't need to be a previous "all".  Just having Octave:language-extension enabled is the problem:

Lachlan Andrew <lachlan>In charge of this item.
Wed 10 Feb 2016 01:11:33 PM UTC, comment #3: 

Carnë, you're absolutely right.  I don't remember what I did to check it, but it was obviously not enough.

Looking at the code, I think it would be best to replace the current special treatment of Octave:matlab-incompatible (a.k.a. Octave:language-extension) with something like your option 2

For warning ("error", "all"):
Step 1. Set the Octave:language-extension to the previous value of "all"
Step 2. Search to see if it previously had an explicit value, in which case that value is retained.

Lachlan Andrew <lachlan>In charge of this item.
Mon 08 Feb 2016 01:08:18 AM UTC, comment #2: 

I still get the error at the end of the sequence building the current default branch (cset d78e45987d6a).

octave-gui:1> a = 1;
octave-gui:2> warning ("on", "all");
octave-gui:3> warning ("error", "all");
octave-gui:4> a++
error: Octave language extension used: ++ used as operator
error: parse error

Carnë Draug <carandraug>
Project Member
Fri 15 Jan 2016 12:16:25 PM UTC, comment #1: 

The current development code gives no errors or warnings from this sequence of commands.  That sounds like your option 1, Carnë.

Can this bug report be closed?

Lachlan Andrew <lachlan>In charge of this item.
Sat 21 Feb 2015 05:00:24 PM UTC, original submission:  

Changing the state of all warnings to error, is supposed to leave "Octave:matlab-incompatible" alone http://hg.savannah.gnu.org/hgweb/octave/file/343ca73b1507/libinterp/corefcn/error.cc#l1515

This works fine unless there has been some change of error state that groups them under "all". The following code is on 3.8.2 but I get the same behavior on dev.

octave-cli-3.8.2:1> a = 1;
octave-cli-3.8.2:2> a++;
octave-cli-3.8.2:3> warning ("error", "all");
octave-cli-3.8.2:4> a++;
octave-cli-3.8.2:5> warning ("on", "all");
octave-cli-3.8.2:6> a++;
warning: potential Matlab compatibility problem: ++ used as operator
octave-cli-3.8.2:7> warning ("error", "all");
octave-cli-3.8.2:8> a++;
error: potential Matlab compatibility problem: ++ used as operator

I see two possible fixes: 1) have all the changes to 'all' warning ids skip matlab-compatible instead of only error, 2) have error all, set matlab-compatible to the previous state of "all".

Carnë Draug <carandraug>
Project Member


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

Attach Files:

Attached Files
file #36311:  bug_44336.cset added by lachlan (3KiB - application/octet-stream)


Depends on the following items: None found

Items that depend on this one: None found


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

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

    Only project members can vote.




    Follow 6 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2016-08-08 rik5 StatusPatch Submitted => Fixed
        Open/ClosedOpen => Closed
    2016-02-26 lachlan Severity3 - Normal => 2 - Minor
        StatusNone => Patch Submitted
        Assigned toNone => lachlan
    2016-02-11 lachlan Attached File- => Added bug_44336.cset, #36311

    Back to the top

    Powered by Savane 3.5