octave-bug-tracker
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Octave-bug-tracker] [bug #44336] warning ("error", "all") changes "matl


From: Lachlan Andrew
Subject: [Octave-bug-tracker] [bug #44336] warning ("error", "all") changes "matlab-compatible" warnings if there's an "all" status before
Date: Thu, 11 Feb 2016 10:15:45 +0000
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:43.0) Gecko/20100101 Firefox/43.0

Follow-up Comment #4, bug #44336 (project octave):

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


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

It is a property of the state, not of how warning("error","all") works.


octave:3> b = warning ("query");
octave:4> [{b.identifier}', {b.state}']'
ans = 
{
  [1,1] = all
  [2,1] = error
  [1,2] = Octave:language-extension
  [2,2] = on
  [1,3] = Octave:single-quote-string
  [2,3] = on
}
octave:5> a=1; a++
error: Octave language extension used: ++ used as operator
error: parse error


The reason is that warning_enabled decides that if "all"=="error", then
anything other than "off" gives error, even if one ID is explicitly set to be
"on":


  else if (all_state == 2)
    {
      if (id_state == 0)
        retval= id_state;
      else
        retval = all_state;
    }


That neither option 1 nor option 2 will work.  The only solutions are:

3. Set Octave:language-extension="off" for warning("error","all")
4. Change warning_enabled.

Option 4 may risk Matlab compatibility.  The attached patch implements option
3.

(file #36311)
    _______________________________________________________

Additional Item Attachment:

File name: bug_44336.cset                 Size:2 KB


    _______________________________________________________

Reply to this item at:

  <http://savannah.gnu.org/bugs/?44336>

_______________________________________________
  Message sent via/by Savannah
  http://savannah.gnu.org/




reply via email to

[Prev in Thread] Current Thread [Next in Thread]