bugGNU Octave - Bugs: bug #46650, disable warning about division by...

 
 

bug #46650: disable warning about division by zero by default

Submitter:  Ceral Paquet <octavebugs>
Submitted:  Thu 10 Dec 2015 11:52:20 AM UTC
   
 
Category:  Interpreter Severity:  1 - Wish
Priority:  3 - Low Item Group:  Matlab Compatibility
Status:  Fixed Assigned to:  siko1056
Originator Name:  Open/Closed:  * Closed
Release:  * dev Operating System:  * Any
Fixed Release:  None Planned Release:  None
* Mandatory Fields

Add a New Comment Rich Markup
   

Jump to the original submission

Thu 24 Jan 2019 07:27:37 AM UTC, comment #19: 

Congratulation, you beat the buildbot by far.
The buildbot for default-win64-64 also successfully builds of-control:
http://buildbot.octave.org:8010/#/builders/18/builds/248/steps/7/logs/stdio

(default-w64-32 and default-w32 fail because of compromised local repositories.)

Closing as fixed.

Markus Mützel <mmuetzel>
Group administrator
Wed 23 Jan 2019 08:27:26 PM UTC, comment #18: 

Indeed, with this change, of-control gets cross-built fine.
Thanks Mike.

Philip Nienhuis <philipnienhuis>
Group Member
Wed 23 Jan 2019 08:26:25 PM UTC, comment #17: 

He he....

Do the buildbots actually build OF packages?
If not I might be faster, as first building Octave on Linux and then creating the dist archive for mxe-octave didn't yield any errors; nor cross-building default-octave itself.
It was only with cross-building the first OF package (control) that this bug showed up.

So, it seems the relevant stanza in errwarn.h doesn't do anything in Octave itself and is only there to aid OF packages. Or do I miss something?

What I can do I change the relevant stanza in <mxe-octave>/usr/<arch>/mingw64/include/octave-6.0.0/octave/errwarn.h by hand and try to get of-control cross-built. (I simply removed the entire stanza).

A next cross-build of default-octave (some other evening this week) will overwrite/renew all include files anyway so IMO this is a Q&D yet efficient way to check ...


Philip Nienhuis <philipnienhuis>
Group Member
Wed 23 Jan 2019 02:18:48 PM UTC, comment #16: 

Marking the report as ready for test.
Let's see if Philip or the buildbots are faster to confirm the fix. :-)

Markus Mützel <mmuetzel>
Group administrator
Wed 23 Jan 2019 01:18:27 PM UTC, comment #15: 

Sorry for the trouble and thanks Mike for the fix.  Is there still anything to do?

Kai Torben Ohlhus <siko1056>
Group Member
Wed 23 Jan 2019 08:11:14 AM UTC, comment #14: 

I think this is already fixed with

https://hg.savannah.gnu.org/hgweb/octave/rev/884fdd6c9210

I didn't bother to try to reproduce before I made this fix, but it looks right to me if someone can verify before and after this fix.

Mike Miller <mtmiller>
Group Member
Wed 23 Jan 2019 08:01:14 AM UTC, comment #13: 

That change seems to have broken of-optim (and possibly other packages). See bug #55325:
https://savannah.gnu.org/bugs/?55325#comment31

Markus Mützel <mmuetzel>
Group administrator
Tue 22 Jan 2019 01:40:19 PM UTC, comment #12: 

Warning is removed: https://hg.savannah.gnu.org/hgweb/octave/rev/cc0d942d0e20

External libraries depending on the (errwarn.h) function "warn_divide_by_zero" will get a deprecation warning.

Kai Torben Ohlhus <siko1056>
Group Member
Fri 21 Dec 2018 09:25:20 PM UTC, comment #11: 

It was recently mentioned on bug #55232 that there is consensus that this warning will be disabled and/or removed entirely from Octave on the Octave 6 release branch:

> The decision there was that Octave would remove the division by zero warning.
> In fact, that is one of the first things that I want to see happen on the
> development branch once 5.0 is shipped.


Just updating this bug report that the issue has not been forgotten and is due to be fixed on the development branch soon.

Mike Miller <mtmiller>
Group Member
Sat 02 Jan 2016 08:18:09 PM UTC, comment #10: 

I think we can remove the warning, but maybe we should keep and deprecate the gripe_divide_by_zero function?  I don't care that much though.  I guess it depends on how friendly we want to be to people who use the Octave libraries outside of Octave.

John W. Eaton <jwe>
Group administrator
Sat 02 Jan 2016 06:33:28 PM UTC, comment #9: 

This is implemented by gripe_divide_by_zero.  Can we just remove this completely or do we need to go through a deprecation step and continuing to support this warning for two more releases?

Rik <rik5>
Group administrator
Fri 11 Dec 2015 07:35:13 AM UTC, comment #8: 

Correction: warning was removed sometime between 2009 and 2011.

http://www.mathworks.com/matlabcentral/answers/12677-dividebyzero-warning-does-not-show-up-when-dividing-by-zero

They also mention the remove of the logofzero warning,  which octave doesn't have anyway.

Ceral Paquet <octavebugs>
Fri 11 Dec 2015 07:24:44 AM UTC, comment #7: 

Matlab seems to have removed the warning after R2006b, according to this blog:

http://blogs.mathworks.com/loren/2006/10/18/controlling-warning-messages-and-state/

When I try some things in R2013a it seems the msgid is still valid but the warning is never shown.

>> 1/0


ans =

   Inf
 

>> warning('on','MATLAB:divideByZero')
>> 1/0


ans =

   Inf

>> warning('on','MATLAB:divide-by-zero')

Error using warning
Unknown setting or incorrect message identifier 'MATLAB:divide-by-zero'.
 

>> warning on
>> 1/0


ans =

   Inf

>> warning('query','MATLAB:divideByZero')

The state of warning 'MATLAB:divideByZero' is 'on'.

>> 1/0


ans =

   Inf

Ceral Paquet <octavebugs>
Thu 10 Dec 2015 07:39:32 PM UTC, comment #6: 

Just to be clear, I'd be glad to see it disappear completely.  It's kind of useless anyway, as it only applies to scalar division by zero in the scripting language, not other places where division by zero may occur.

John W. Eaton <jwe>
Group administrator
Thu 10 Dec 2015 06:52:50 PM UTC, comment #5: 

I'm pretty sure that Matlab used to warn by default as well.  When did it change?  Does it still have the MATLAB:divideByZero warning ID or was that completely eliminated?

John W. Eaton <jwe>
Group administrator
Thu 10 Dec 2015 05:50:20 PM UTC, comment #4: 

I don't personally see much value in debating defaults. The warning is documented and is completely user configurable. I don't think bug reports about changing the default value of something like this that is easily configurable tend to go anywhere, but I'll leave open for other comments.

Mike Miller <mtmiller>
Group Member
Thu 10 Dec 2015 05:47:15 PM UTC, comment #3: 

Hi Mike - yes, it's a defaults issue. On Matlab, there is no warning so people write code in loops like 1/x without bothering to check for 0. In Octave, this barfs out warnings which looks bad and runs slow, so I would go with the warning off as the default.

Ceral Paquet <octavebugs>
Thu 10 Dec 2015 04:25:07 PM UTC, comment #2: 

And that turns off the warning, correct? The warning is on by default but is configurable using that warning ID, I think Octave is doing enough to make it behave how you want.

Mike Miller <mtmiller>
Group Member
Thu 10 Dec 2015 04:17:45 PM UTC, comment #1: 

Just for info, I added

warning("off","Octave:divide-by-zero")

to my .octaverc file to get rid of it.

Ceral Paquet <octavebugs>
Thu 10 Dec 2015 11:52:20 AM UTC, original submission:  

When running some Matlab code in Octave, I get pages of warning about division by zero. Aparently Matlab does not warn about that.

octave:2> 1/0
warning: division by zero
ans = Inf

In Matlab:

>> 1/0

ans =
   Inf

Ceral Paquet <octavebugs>

 

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

Attach Files:
   
   
Comment:
   

No files currently attached

 

Carbon-Copy List
  • -email is unavailable- added by mmuetzel (Posted a comment)
  • -email is unavailable- added by siko1056 (Posted a comment)
  • -email is unavailable- added by rik5 (Posted a comment)
  • -email is unavailable- added by jwe (Posted a comment)
  • -email is unavailable- added by octavebugs (Submitted the item)
  •  

    There are 0 votes so far. Votes easily highlight which items people would like to see resolved in priority, independently of the priority of the item set by tracker managers.

    Only group members can vote.

     

    Follow 20 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2019-01-24 mmuetzel StatusReady For Test Fixed
        Open/ClosedOpen Closed
    2019-01-23 mmuetzel StatusIn Progress Ready For Test
    2019-01-23 mtmiller Carbon-CopyRemoved 80942 -
    2019-01-23 mmuetzel StatusFixed In Progress
        Open/ClosedClosed Open
    2019-01-22 siko1056 StatusConfirmed Fixed
        Assigned toNone siko1056
        Open/ClosedOpen Closed
    2018-12-21 mtmiller StatusNeed Info Confirmed
    2018-12-21 mtmiller Dependencies- bugs #55264 is dependent
    2018-12-16 rik5 Dependencies- bugs #55232 is dependent
    2017-08-27 mtmiller Dependencies- bugs #51649 is dependent
    2015-12-10 mtmiller Severity3 - Normal 1 - Wish
        Priority5 - Normal 3 - Low
        Release4.0.0 dev
        Operating SystemGNU/Linux Any
        SummaryDon\'t warn about division by zero disable warning about division by zero by default
    2015-12-10 mtmiller CategoryNone Interpreter
        StatusNone Need Info

    Back to the top

    Powered by Savane 3.13-4448.
    Corresponding source code