]> Creatis software - CreaPhase.git/blob - octave_packages/m/miscellaneous/warning_ids.m
update packages
[CreaPhase.git] / octave_packages / m / miscellaneous / warning_ids.m
1 ## Copyright (C) 2006-2012 John W. Eaton
2 ##
3 ## This file is part of Octave.
4 ##
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.
9 ##
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.
14 ##
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/>.
18
19 ## -*- texinfo -*-
20 ## @cindex warning ids
21 ## @table @code
22 ## @item Octave:abbreviated-property-match
23 ## By default, the @code{Octave:abbreviated-property-match} warning is enabled.
24 ##
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
28 ## attempted.
29 ## By default, the @code{Octave:array-to-scalar} warning is disabled.
30 ##
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
34 ## attempted.
35 ## By default, the @code{Octave:array-to-vector} warning is disabled.
36 ##
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
40 ##
41 ## @example
42 ## @group
43 ## if (s = t)
44 ##   @dots{}
45 ## @end group
46 ## @end example
47 ##
48 ## @noindent
49 ## since such statements are not common, and it is likely that the intent
50 ## was to write
51 ##
52 ## @example
53 ## @group
54 ## if (s == t)
55 ##   @dots{}
56 ## @end group
57 ## @end example
58 ##
59 ## @noindent
60 ## instead.
61 ##
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
65 ##
66 ## @example
67 ## @group
68 ## while (c = getc ())
69 ##   @dots{}
70 ## @end group
71 ## @end example
72 ##
73 ## @noindent
74 ## are common in C programming.
75 ##
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
79 ##
80 ## @example
81 ## @group
82 ## if (x = 1)  # intended to test (x == 1)!
83 ##   @dots{}
84 ## @end group
85 ## @end example
86 ##
87 ## @noindent
88 ## slip by.
89 ##
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
93 ##
94 ## @example
95 ## @group
96 ## while ((c = getc ()))
97 ##   @dots{}
98 ## @end group
99 ## @end example
100 ##
101 ## @noindent
102 ## will prevent the warning from being printed for this statement, while
103 ## allowing Octave to warn about other assignments used in conditional
104 ## contexts.
105 ##
106 ## By default, the @code{Octave:assign-as-truth-value} warning is enabled.
107 ##
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}
113 ## compatibility.
114 ## By default, the @code{Octave:associativity-change} warning is enabled.
115 ##
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.
123 ##
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.
128 ##
129 ## @item Octave:built-in-variable-assignment
130 ## By default, the @code{Octave:built-in-variable-assignment} warning is
131 ## enabled.
132 ##
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.
137 ##
138 ## @item Octave:fopen-file-in-path
139 ## By default, the @code{Octave:fopen-file-in-path} warning is enabled.
140 ##
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.
147 ##
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.
153 ##
154 ## @item Octave:glyph-render
155 ## By default, the @code{Octave:glyph-render} warning is enabled.
156 ##
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.
161 ##
162 ## @item Octave:load-file-in-path
163 ## By default, the @code{Octave:load-file-in-path} warning is enabled.
164 ##
165 ## @item Octave:logical-conversion
166 ## By default, the @code{Octave:logical-conversion} warning is enabled.
167 ##
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.
172 ##
173 ## @item Octave:md5sum-file-in-path
174 ## By default, the @code{Octave:md5sum-file-in-path} warning is enabled.
175 ##
176 ## @item Octave:missing-glyph
177 ## By default, the @code{Octave:missing-glyph} warning is enabled.
178 ##
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
182 ## semicolons.
183 ## By default the @code{Octave:missing-semicolon} warning is disabled.
184 ##
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.
189 ##
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
193 ##
194 ## @example
195 ## eye (-1)
196 ## @end example
197 ##
198 ## @noindent
199 ## By default, the @code{Octave:neg-dim-as-zero} warning is disabled.
200 ##
201 ## @item Octave:nested-functions-coerced
202 ## By default, the @code{Octave:nested-functions-coerced} warning is enabled.
203 ##
204 ## @item Octave:noninteger-range-as-index
205 ## By default, the @code{Octave:noninteger-range-as-index} warning is enabled.
206 ##
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,
212 ##
213 ## @example
214 ## @group
215 ## [ "f", 111, 111 ]
216 ## @result{} "foo"
217 ## @end group
218 ## @end example
219 ##
220 ## @noindent
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.
223 ##
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
231 ##
232 ## @example
233 ## @group
234 ## do_braindead_shortcircuit_evaluation (1)
235 ## @end group
236 ## @end example
237 ##
238 ## @noindent
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
245 ## is enabled.
246 ##
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.
253 ##
254 ## @item Octave:recursive-path-search
255 ## By default, the @code{Octave:recursive-path-search} warning is enabled.
256 ##
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.
264 ##
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.
270 ##
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.
275 ##
276 ## @item Octave:shadowed-function
277 ## By default, the @code{Octave:shadowed-function} warning is enabled.
278 ##
279 ## @item Octave:single-quote-string
280 ## Print warning if a single quote character is used to introduce a
281 ## string constant.
282 ## By default, the @code{Octave:single-quote-string} warning is disabled.
283 ##
284 ## @item Octave:singular-matrix-div
285 ## By default, the @code{Octave:singular-matrix-div} warning is enabled.
286 ##
287 ## @item Octave:sqrtm:SingularMatrix
288 ## By default, the @code{Octave:sqrtm:SingularMatrix} warning is enabled.
289 ##
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.
293 ## For example,
294 ##
295 ## @example
296 ## @group
297 ## "abc" + 0
298 ## @result{} 97 98 99
299 ## @end group
300 ## @end example
301 ##
302 ## @noindent
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.
305 ##
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.
311 ##
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
315 ## expression.
316 ## By default, the @code{Octave:variable-switch-label} warning is disabled.
317 ## @end table
318
319 function warning_ids ()
320   help ("warning_ids");
321 endfunction
322
323 ## Remove from test statistics.  No real tests possible
324 %!assert (1)