Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove 'warning off' #15

Open
RomeshA opened this issue Apr 19, 2017 · 0 comments
Open

Remove 'warning off' #15

RomeshA opened this issue Apr 19, 2017 · 0 comments
Projects

Comments

@RomeshA
Copy link
Collaborator

RomeshA commented Apr 19, 2017

In general, the pattern

warning off
stuff()
warning on    

this can lead to unpredictable behaviour (specifically, other unrelated warnings unexpectedly not being raised) if an error occurs while running stuff(). It would be better to check explicitly for the warning conditions. For example, instead of

warning off
mkdir(dirname)
warning on

it should read

if ~exist(dirname,'dir')
    mkdir(dirname)
end

This needs to be replaced in a number of places. As a somewhat weaker alternative, in some places specific warnings could be disabled instead of all warnings e.g. suppressing divide by zero warnings

@RomeshA RomeshA added this to Issues in Upgrade OPT Oct 27, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Development

No branches or pull requests

1 participant