1 ## Copyright (C) 2006-2012 John W. Eaton
3 ## This file is part of Octave.
5 ## Octave is free software; you can redistribute it and/or modify it
6 ## under the terms of the GNU General Public License as published by
7 ## the Free Software Foundation; either version 3 of the License, or (at
8 ## your option) any later version.
10 ## Octave is distributed in the hope that it will be useful, but
11 ## WITHOUT ANY WARRANTY; without even the implied warranty of
12 ## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 ## General Public License for more details.
15 ## You should have received a copy of the GNU General Public License
16 ## along with Octave; see the file COPYING. If not, see
17 ## <http://www.gnu.org/licenses/>.
20 ## @cindex warning ids
22 ## @item Octave:abbreviated-property-match
23 ## By default, the @code{Octave:abbreviated-property-match} warning is enabled.
25 ## @item Octave:array-to-scalar
26 ## If the @code{Octave:array-to-scalar} warning is enabled, Octave will
27 ## warn when an implicit conversion from an array to a scalar value is
29 ## By default, the @code{Octave:array-to-scalar} warning is disabled.
31 ## @item Octave:array-to-vector
32 ## If the @code{Octave:array-to-vector} warning is enabled, Octave will
33 ## warn when an implicit conversion from an array to a vector value is
35 ## By default, the @code{Octave:array-to-vector} warning is disabled.
37 ## @item Octave:assign-as-truth-value
38 ## If the @code{Octave:assign-as-truth-value} warning is
39 ## enabled, a warning is issued for statements like
49 ## since such statements are not common, and it is likely that the intent
62 ## There are times when it is useful to write code that contains
63 ## assignments within the condition of a @code{while} or @code{if}
64 ## statement. For example, statements like
68 ## while (c = getc ())
74 ## are common in C programming.
76 ## It is possible to avoid all warnings about such statements by
77 ## disabling the @code{Octave:assign-as-truth-value} warning,
78 ## but that may also let real errors like
82 ## if (x = 1) # intended to test (x == 1)!
90 ## In such cases, it is possible suppress errors for specific statements by
91 ## writing them with an extra set of parentheses. For example, writing the
92 ## previous example as
96 ## while ((c = getc ()))
102 ## will prevent the warning from being printed for this statement, while
103 ## allowing Octave to warn about other assignments used in conditional
106 ## By default, the @code{Octave:assign-as-truth-value} warning is enabled.
108 ## @item Octave:associativity-change
109 ## If the @code{Octave:associativity-change} warning is
110 ## enabled, Octave will warn about possible changes in the meaning of
111 ## some code due to changes in associativity for some operators.
112 ## Associativity changes have typically been made for @sc{matlab}
114 ## By default, the @code{Octave:associativity-change} warning is enabled.
116 ## @item Octave:autoload-relative-file-name
117 ## If the @code{Octave:autoload-relative-file-name} is enabled,
118 ## Octave will warn when parsing autoload() function calls with relative
119 ## paths to function files. This usually happens when using autoload()
120 ## calls in PKG_ADD files, when the PKG_ADD file is not in the same
121 ## directory as the .oct file referred to by the autoload() command.
122 ## By default, the @code{Octave:autoload-relative-file-name} warning is enabled.
124 ## @item Octave:broadcast
125 ## Warn when performing broadcasting operations. By default, this is
126 ## enabled. See @ref{Broadcasting} in the chapter Vectorization and Faster
127 ## Code Execution of the manual.
129 ## @item Octave:built-in-variable-assignment
130 ## By default, the @code{Octave:built-in-variable-assignment} warning is
133 ## @item Octave:divide-by-zero
134 ## If the @code{Octave:divide-by-zero} warning is enabled, a
135 ## warning is issued when Octave encounters a division by zero.
136 ## By default, the @code{Octave:divide-by-zero} warning is enabled.
138 ## @item Octave:fopen-file-in-path
139 ## By default, the @code{Octave:fopen-file-in-path} warning is enabled.
141 ## @item Octave:function-name-clash
142 ## If the @code{Octave:function-name-clash} warning is enabled, a
143 ## warning is issued when Octave finds that the name of a function
144 ## defined in a function file differs from the name of the file. (If
145 ## the names disagree, the name declared inside the file is ignored.)
146 ## By default, the @code{Octave:function-name-clash} warning is enabled.
148 ## @item Octave:future-time-stamp
149 ## If the @code{Octave:future-time-stamp} warning is enabled, Octave
150 ## will print a warning if it finds a function file with a time stamp
151 ## that is in the future.
152 ## By default, the @code{Octave:future-time-stamp} warning is enabled.
154 ## @item Octave:glyph-render
155 ## By default, the @code{Octave:glyph-render} warning is enabled.
157 ## @item Octave:imag-to-real
158 ## If the @code{Octave:imag-to-real} warning is enabled, a warning is
159 ## printed for implicit conversions of complex numbers to real numbers.
160 ## By default, the @code{Octave:imag-to-real} warning is disabled.
162 ## @item Octave:load-file-in-path
163 ## By default, the @code{Octave:load-file-in-path} warning is enabled.
165 ## @item Octave:logical-conversion
166 ## By default, the @code{Octave:logical-conversion} warning is enabled.
168 ## @item Octave:matlab-incompatible
169 ## Print warnings for Octave language features that may cause
170 ## compatibility problems with @sc{matlab}.
171 ## By default, the @code{Octave:matlab-incompatible} warning is disabled.
173 ## @item Octave:md5sum-file-in-path
174 ## By default, the @code{Octave:md5sum-file-in-path} warning is enabled.
176 ## @item Octave:missing-glyph
177 ## By default, the @code{Octave:missing-glyph} warning is enabled.
179 ## @item Octave:missing-semicolon
180 ## If the @code{Octave:missing-semicolon} warning is enabled, Octave
181 ## will warn when statements in function definitions don't end in
183 ## By default the @code{Octave:missing-semicolon} warning is disabled.
185 ## @item Octave:mixed-string-concat
186 ## If the @code{Octave:mixed-string-concat} warning is enabled, print a
187 ## warning when concatenating a mixture of double and single quoted strings.
188 ## By default, the @code{Octave:mixed-string-concat} warning is disabled.
190 ## @item Octave:neg-dim-as-zero
191 ## If the @code{Octave:neg-dim-as-zero} warning is enabled, print a warning
192 ## for expressions like
199 ## By default, the @code{Octave:neg-dim-as-zero} warning is disabled.
201 ## @item Octave:nested-functions-coerced
202 ## By default, the @code{Octave:nested-functions-coerced} warning is enabled.
204 ## @item Octave:noninteger-range-as-index
205 ## By default, the @code{Octave:noninteger-range-as-index} warning is enabled.
207 ## @item Octave:num-to-str
208 ## If the @code{Octave:num-to-str} warning is enable, a warning is
209 ## printed for implicit conversions of numbers to their ASCII character
210 ## equivalents when strings are constructed using a mixture of strings and
211 ## numbers in matrix notation. For example,
221 ## elicits a warning if the @code{Octave:num-to-str} warning is
222 ## enabled. By default, the @code{Octave:num-to-str} warning is enabled.
224 ## @item Octave:possible-matlab-short-circuit-operator
225 ## If the @code{Octave:possible-matlab-short-circuit-operator} warning
226 ## is enabled, Octave will warn about using the not short circuiting
227 ## operators @code{&} and @code{|} inside @code{if} or @code{while}
228 ## conditions. They normally never short circuit, but @sc{matlab} always
229 ## short circuits if any logical operators are used in a condition. You
230 ## can turn on the option
234 ## do_braindead_shortcircuit_evaluation (1)
239 ## if you would like to enable this short-circuit evaluation in
240 ## Octave. Note that the @code{&&} and @code{||} operators always short
241 ## circuit in both Octave and @sc{matlab}, so it's only necessary to
242 ## enable @sc{matlab}-style short-circuiting it's too arduous to modify
243 ## existing code that relies on this behavior.
244 ## By default, the @code{Octave:possible-matlab-short-circuit-operator} warning
247 ## @item Octave:precedence-change
248 ## If the @code{Octave:precedence-change} warning is enabled, Octave
249 ## will warn about possible changes in the meaning of some code due to
250 ## changes in precedence for some operators. Precedence changes have
251 ## typically been made for @sc{matlab} compatibility.
252 ## By default, the @code{Octave:precedence-change} warning is enabled.
254 ## @item Octave:recursive-path-search
255 ## By default, the @code{Octave:recursive-path-search} warning is enabled.
257 ## @item Octave:reload-forces-clear
258 ## If several functions have been loaded from the same file, Octave must
259 ## clear all the functions before any one of them can be reloaded. If
260 ## the @code{Octave:reload-forces-clear} warning is enabled, Octave will
261 ## warn you when this happens, and print a list of the additional
262 ## functions that it is forced to clear.
263 ## By default, the @code{Octave:reload-forces-clear} warning is enabled.
265 ## @item Octave:resize-on-range-error
266 ## If the @code{Octave:resize-on-range-error} warning is enabled, print a
267 ## warning when a matrix is resized by an indexed assignment with
268 ## indices outside the current bounds.
269 ## By default, the ## @code{Octave:resize-on-range-error} warning is disabled.
271 ## @item Octave:separator-insert
272 ## Print warning if commas or semicolons might be inserted
273 ## automatically in literal matrices.
274 ## By default, the @code{Octave:separator-insert} warning is disabled.
276 ## @item Octave:shadowed-function
277 ## By default, the @code{Octave:shadowed-function} warning is enabled.
279 ## @item Octave:single-quote-string
280 ## Print warning if a single quote character is used to introduce a
282 ## By default, the @code{Octave:single-quote-string} warning is disabled.
284 ## @item Octave:singular-matrix-div
285 ## By default, the @code{Octave:singular-matrix-div} warning is enabled.
287 ## @item Octave:sqrtm:SingularMatrix
288 ## By default, the @code{Octave:sqrtm:SingularMatrix} warning is enabled.
290 ## @item Octave:str-to-num
291 ## If the @code{Octave:str-to-num} warning is enabled, a warning is printed
292 ## for implicit conversions of strings to their numeric ASCII equivalents.
298 ## @result{} 97 98 99
303 ## elicits a warning if the @code{Octave:str-to-num} warning is enabled.
304 ## By default, the @code{Octave:str-to-num} warning is disabled.
306 ## @item Octave:undefined-return-values
307 ## If the @code{Octave:undefined-return-values} warning is disabled,
308 ## print a warning if a function does not define all the values in
309 ## the return list which are expected.
310 ## By default, the @code{Octave:undefined-return-values} warning is enabled.
312 ## @item Octave:variable-switch-label
313 ## If the @code{Octave:variable-switch-label} warning is enabled, Octave
314 ## will print a warning if a switch label is not a constant or constant
316 ## By default, the @code{Octave:variable-switch-label} warning is disabled.
319 function warning_ids ()
320 help ("warning_ids");
323 ## Remove from test statistics. No real tests possible