bugGNU Octave - Bugs: bug #41028, warning off shouldn't affect...

 
 

bug #41028: warning off shouldn't affect lastwarn

Submitted by:  Felipe G. Nievinski <fgnievinski>
Submitted on:  Sun 29 Dec 2013 07:38:18 PM UTC  
 
Category: Octave FunctionSeverity: 3 - Normal
Priority: 5 - NormalItem Group: Matlab Compatibility
Status: Patch SubmittedAssigned to: Lachlan Andrew <lachlan>
Originator Name: Open/Closed: Open
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)

Fri 04 Dec 2015 01:40:19 AM UTC, comment #6:

I have freshened the patch.

One caveat with changing the behaviour of "warning off" is that there are many warnings that are off by default but are thrown by core code like "help".

An alternative to this patch is simply to rename "quiet" to "off" and to rename "off" to something like "nothing". That keeps Matlab compatibility and the current flexibility.

I have two related gripes. Please let me know if they should be separate bug reports:

1) Is there a comand to reset the warning status to the original setting, with a dozen or so warnings "off"? If not, I think there should be.

2) The documentation should not recommend "warning(error)", because it breaks commands like "help", without which it is hard to find out how to fix it. I propose adding the keyword "active" as an alternative for "all", but that does not affect warnings that are off, and making that the default set of warnings when none is specified.

I'm happy to write patches for these if they are approved of.

(file #35639)

Lachlan Andrew <lachlan>
Project MemberIn charge of this item.
Mon 29 Dec 2014 04:19:44 AM UTC, comment #5:

@jwe: The patch you submitted for warning is now almost exactly 1 year old. Should it be committed and this bug closed?

Rik <rik5>
Project Administrator
Mon 30 Dec 2013 10:00:37 PM UTC, comment #4:

I'm okay with ditching warning quiet but warning on|off should be retained, to chose whether the message is displayed or not.

Felipe G. Nievinski <fgnievinski>
Mon 30 Dec 2013 09:47:40 PM UTC, comment #3:

I think I would prefer something like the attached patch.

It seems to me that the "warning on|off|query quiet" feature is not needed if the warning id and message are still set when warning is "off". I'm inclined to deprecate this feature and remove it in the future. I don't think that it was ever documented, so maybe we could just remove it.

(file #30136)

John W. Eaton <jwe>
Project Administrator
Mon 30 Dec 2013 08:00:34 PM UTC, comment #2:

unfortunately the undocumented feature "warning quiet" wouldn't help with matlab compatibility, when a user wishes to check lastwarn.

I've submitting a tentative patch; could you please let me know if it's in the right direction or not.

(file #30134)

Felipe G. Nievinski <fgnievinski>
Mon 30 Dec 2013 05:00:31 PM UTC, comment #1:

Have you tried "warning on quiet"? That will suppress the display of warnings but still record them in the background.

Arun Giridhar <arungiridhar>
Sun 29 Dec 2013 07:38:18 PM UTC, original submission:

contrast:

>> warning("on", "Octave:singular-matrix-div"); lastwarn("", "")
>> ones(2) [1;1]; [msg, id] = lastwarn ()

warning: matrix singular to machine precision, rcond = 0
msg = warning: matrix singular to machine precision, rcond = 0
id = Octave:singular-matrix-div

to:

>> warning("off", "Octave:singular-matrix-div"); lastwarn("", "")
>> ones(2) [1;1]; [msg, id] = lastwarn ()

{no warning displayed}
msg =
id =

it should do instead:

>> warning("off", "Octave:singular-matrix-div"); lastwarn("", "")
>> ones(2) [1;1]; [msg, id] = lastwarn ()

{no warning displayed}
msg = warning: matrix singular to machine precision, rcond = 0
id = Octave:singular-matrix-div

Felipe G. Nievinski <fgnievinski>

 

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

Attach File(s):
   
   
Comment:
   

Attached Files
file #30136:  diffs.txt added by jwe (3KiB - text/plain)
file #30134:  lastwarn.diff added by fgnievinski (873B - application/octet-stream)

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -unavailable- added by lachlan (Updated the item)
  • -unavailable- added by rik5 (Posted a comment)
  • -unavailable- added by mtmiller (Updated the item)
  • -unavailable- added by jwe (Updated the item)
  • -unavailable- added by arungiridhar (Posted a comment)
  • -unavailable- added by fgnievinski (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
    Thu 31 Mar 2016 05:37:34 AM UTCmtmillerRelease3.6.4=>dev
      Operating SystemMicrosoft Windows=>Any
    Fri 26 Feb 2016 05:59:08 PM UTCrik5Assigned toNone=>lachlan
    Fri 04 Dec 2015 01:40:19 AM UTClachlanAttached File-=>Added bug_41028-warn-quiet-freshened.txt, #35639
    Sun 19 Jan 2014 07:02:20 PM UTCmtmillerCategoryNone=>Octave Function
      StatusNone=>Patch Submitted
    Mon 30 Dec 2013 09:47:39 PM UTCjweAttached File-=>Added diffs.txt, #30136
    Mon 30 Dec 2013 08:00:34 PM UTCfgnievinskiAttached File-=>Added lastwarn.diff, #30134

    Back to the top


    Powered by Savane 3.1-cleanup1