1function warning_config()
2% Activates useful warnings
3%
4% INPUTS
5%   none
6%
7% OUTPUTS
8%   none
9%
10% SPECIAL REQUIREMENTS
11%   none
12
13% Copyright (C) 2008-2017 Dynare Team
14%
15% This file is part of Dynare.
16%
17% Dynare is free software: you can redistribute it and/or modify
18% it under the terms of the GNU General Public License as published by
19% the Free Software Foundation, either version 3 of the License, or
20% (at your option) any later version.
21%
22% Dynare is distributed in the hope that it will be useful,
23% but WITHOUT ANY WARRANTY; without even the implied warranty of
24% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
25% GNU General Public License for more details.
26%
27% You should have received a copy of the GNU General Public License
28% along with Dynare.  If not, see <http://www.gnu.org/licenses/>.
29
30warning on;
31
32% Display a calling stack trace when a warning is issued
33warning('on', 'backtrace');
34
35if isoctave
36    warning('off', 'Octave:separator-insert');
37    warning('off', 'Octave:language-extension');
38    warning('off', 'Octave:single-quote-string');
39    warning('off', 'Octave:missing-semicolon');
40    warning('off', 'Octave:empty-list-elements');
41    warning('off', 'Octave:num-to-str');
42    warning('off', 'Octave:resize-on-range-error');
43    warning('off', 'Octave:str-to-num');
44    warning('off', 'Octave:array-as-scalar');
45    warning('off', 'Octave:array-as-vector');
46    warning('off', 'Octave:mixed-string-concat');
47    warning('off', 'Octave:variable-switch-label');
48    warning('off', 'Octave:fortran-indexing');
49    warning('off', 'Octave:classdef-to-struct');
50    warning('off', 'Octave:legacy-function'); % For strmatch and isdir
51else
52    % In MATLAB >= 7.7, don't display a warning if we use deprecated
53    % interface to set seed of random number generators
54    warning('off', 'MATLAB:RandStream:ActivatingLegacyGenerators');
55end
56
57lastwarn('') % Reset lastwarn, used to determine later if a warning has been emitted
58