bugGNU Octave - Bugs: bug #53587, Disabling an invalid warning ID...

 
 

bug #53587: Disabling an invalid warning ID should give an error

Submitted by:  Marco Caliari <caliari>
Submitted on:  Mon 09 Apr 2018 06:46:22 AM UTC  
 
Category: Octave FunctionSeverity: 3 - Normal
Priority: 5 - NormalItem Group: Missed Error or Warning
Status: ConfirmedAssigned to: None
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)

Wed 11 Apr 2018 08:17:56 PM UTC, comment #7:

@jwe: We're in the same boat. I thought it would be easy so I took a look, and then was overwhelmed by the input parsing.

Rik <rik5>
Project Administrator
Wed 11 Apr 2018 08:05:00 PM UTC, comment #6:

Rik, I tried to do that earlier today. Writing a separate function to do the the check is easy enough, as there is already a conditional statement that does it. But where to place it is more complicated because the logic for decoding the arguments to the warning function is fairly complicated. I eventually gave up.

John W. Eaton <jwe>
Project Administrator
Wed 11 Apr 2018 07:03:47 PM UTC, comment #5:

I took a look at error.cc. Unfortunately, there are several places where the warning ID is used. Probably the best thing is to write a short subroutine to validate warning IDs so that the code is all in one place, and then call validate_ID from everywhere that is required in error.cc.

Rik <rik5>
Project Administrator
Mon 09 Apr 2018 03:27:34 PM UTC, comment #4:

We can't know the ilst of possible warnings. Packages are free to define their own IDs, and so are users. All we can determine in core Octave is whether the ID has the correct form.

Rik <rik5>
Project Administrator
Mon 09 Apr 2018 08:05:15 AM UTC, comment #3:

Agreed, a colon is mandatory in Matlab, and Octave also uses that as one of the requirements to determine if the first argument is a warning ID or just a warning string:

libinterp/corefcn/error.cc:1087

So that logic might as well be applied to the warning ID passed to warning on/off/query/error.

Mike Miller <mtmiller>
Project Administrator
Mon 09 Apr 2018 07:55:33 AM UTC, comment #2:

For reference with Matlab R2016a:

So a colon seems to be obligatory. I don't know whether we impose the same restriction in Octave.

Markus M├╝tzel <mmuetzel>
Project Member
Mon 09 Apr 2018 07:05:20 AM UTC, comment #1:

Do you mean invalid rather than an undefined warning ID? What are defined warning IDs? Doesn't that imply some kind of central registration point for all warning IDs? The way I understand it, any user function can define any arbitrary warning ID.

We could raise an error for some invalid warning identifier, for example

Mike Miller <mtmiller>
Project Administrator
Mon 09 Apr 2018 06:46:22 AM UTC, original submission:

If you try something like

you get no error, while it should be reasonable (and it would be a compatible behavior) to get it.

Marco Caliari <caliari>
Project Member

 

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

Attach File(s):
   
   
Comment:
   

No files currently attached

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -unavailable- added by jwe (Posted a comment)
  • -unavailable- added by rik5 (Posted a comment)
  • -unavailable- added by mmuetzel (Posted a comment)
  • -unavailable- added by mtmiller (Posted a comment)
  • -unavailable- added by caliari (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 3 latest changes.

    Date Changed By Updated Field Previous Value => Replaced By
    Mon 09 Apr 2018 08:05:15 AM UTCmtmillerStatusNeed Info=>Confirmed
    Mon 09 Apr 2018 07:08:36 AM UTCcaliariSummaryDisabling an undefined warning ID should give an error=>Disabling an invalid warning ID should give an error
    Mon 09 Apr 2018 07:05:20 AM UTCmtmillerStatusNone=>Need Info

    Back to the top


    Powered by Savane 3.1-cleanup1