7017
|
1 ## Copyright (C) 2006, 2007 John W. Eaton |
7016
|
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 |
5781
|
19 ## -*- texinfo -*- |
|
20 ## @table @code |
|
21 ## @item Octave:array-to-scalar |
|
22 ## If the @code{Octave:array-to-scalar} warning is enabled, Octave will |
|
23 ## warn when an implicit conversion from an array to a scalar value is |
|
24 ## attempted. By default, the @code{Octave:array-to-scalar} warning is |
|
25 ## disabled. |
|
26 ## |
|
27 ## @item Octave:array-to-vector |
|
28 ## If the @code{Octave:array-to-vector} warning is enabled, Octave will |
|
29 ## warn when an implicit conversion from an array to a vector value is |
|
30 ## attempted. By default, the @code{Octave:array-to-vector} warning is |
|
31 ## disabled. |
|
32 ## |
|
33 ## @item Octave:assign-as-truth-value |
|
34 ## If the @code{Octave:assign-as-truth-value} warning is |
|
35 ## enabled, a warning is issued for statements like |
|
36 ## |
|
37 ## @example |
|
38 ## if (s = t) |
|
39 ## ... |
|
40 ## @end example |
|
41 ## |
|
42 ## @noindent |
|
43 ## since such statements are not common, and it is likely that the intent |
|
44 ## was to write |
|
45 ## |
|
46 ## @example |
|
47 ## if (s == t) |
|
48 ## ... |
|
49 ## @end example |
|
50 ## |
|
51 ## @noindent |
|
52 ## instead. |
|
53 ## |
|
54 ## There are times when it is useful to write code that contains |
|
55 ## assignments within the condition of a @code{while} or @code{if} |
|
56 ## statement. For example, statements like |
|
57 ## |
|
58 ## @example |
|
59 ## while (c = getc()) |
|
60 ## ... |
|
61 ## @end example |
|
62 ## |
|
63 ## @noindent |
|
64 ## are common in C programming. |
|
65 ## |
|
66 ## It is possible to avoid all warnings about such statements by |
|
67 ## disabling the @code{Octave:assign-as-truth-value} warning, |
|
68 ## but that may also let real errors like |
|
69 ## |
|
70 ## @example |
|
71 ## if (x = 1) # intended to test (x == 1)! |
|
72 ## ... |
|
73 ## @end example |
|
74 ## |
|
75 ## @noindent |
|
76 ## slip by. |
|
77 ## |
|
78 ## In such cases, it is possible suppress errors for specific statements by |
|
79 ## writing them with an extra set of parentheses. For example, writing the |
|
80 ## previous example as |
|
81 ## |
|
82 ## @example |
|
83 ## while ((c = getc())) |
|
84 ## ... |
|
85 ## @end example |
|
86 ## |
|
87 ## @noindent |
|
88 ## will prevent the warning from being printed for this statement, while |
|
89 ## allowing Octave to warn about other assignments used in conditional |
|
90 ## contexts. |
|
91 ## |
|
92 ## By default, the @code{Octave:assign-as-truth-value} warning is enabled. |
|
93 ## |
|
94 ## @item Octave:associativity-change |
|
95 ## If the @code{Octave:associativity-change} warning is |
|
96 ## enabled, Octave will warn about possible changes in the meaning of |
|
97 ## some code due to changes in associativity for some operators. |
6555
|
98 ## Associativity changes have typically been made for @sc{Matlab} |
5781
|
99 ## compatibility. By default, the @code{Octave:associativity-change} |
|
100 ## warning is enabled. |
|
101 ## |
|
102 ## @item Octave:divide-by-zero |
|
103 ## If the @code{Octave:divide-by-zero} warning is enabled, a |
|
104 ## warning is issued when Octave encounters a division by zero. By |
|
105 ## default, the @code{Octave:divide-by-zero} warning is enabled. |
|
106 ## |
|
107 ## @item Octave:empty-list-elements |
|
108 ## If the @code{Octave:empty-list-elements} warning is enabled, a |
|
109 ## warning is issued when an empty matrix is found in a matrix list. |
|
110 ## For example, |
|
111 ## |
|
112 ## @example |
|
113 ## a = [1, [], 3, [], 5] |
|
114 ## @end example |
|
115 ## |
|
116 ## @noindent |
|
117 ## By default, the @code{Octave:empty-list-elements} warning is enabled. |
|
118 ## |
|
119 ## @item Octave:fortran-indexing |
|
120 ## If the @code{Octave:fortran-indexing} warning is enabled, a warning is |
|
121 ## printed for expressions which select elements of a two-dimensional matrix |
|
122 ## using a single index. By default, the @code{Octave:fortran-indexing} |
|
123 ## warning is disabled. |
|
124 ## |
|
125 ## @item Octave:function-name-clash |
|
126 ## If the @code{Octave:function-name-clash} warning is enabled, a |
|
127 ## warning is issued when Octave finds that the name of a function |
|
128 ## defined in a function file differs from the name of the file. (If |
|
129 ## the names disagree, the name declared inside the file is ignored.) |
|
130 ## By default, the @code{Octave:function-name-clash} warning is enabled. |
|
131 ## |
|
132 ## @item Octave:future-time-stamp |
|
133 ## If the @code{Octave:future-time-stamp} warning is enabled, Octave |
|
134 ## will print a warning if it finds a function file with a time stamp |
|
135 ## that is in the future. By default, the |
|
136 ## @code{Octave:future-time-stamp} warning is enabled. |
|
137 ## |
|
138 ## @item Octave:imag-to-real |
|
139 ## If the @code{Octave:imag-to-real} warning is enabled, a warning is |
|
140 ## printed for implicit conversions of complex numbers to real numbers. |
|
141 ## By default, the @code{Octave:imag-to-real} warning is disabled. |
|
142 ## |
5794
|
143 ## @item Octave:matlab-incompatible |
|
144 ## Print warnings for Octave language features that may cause |
6555
|
145 ## compatibility problems with @sc{Matlab}. |
5794
|
146 ## |
5781
|
147 ## @item Octave:missing-semicolon |
|
148 ## If the @code{Octave:missing-semicolon} warning is enabled, Octave |
|
149 ## will warn when statements in function definitions don't end in |
|
150 ## semicolons. By default the @code{Octave:missing-semicolon} warning |
|
151 ## is disabled. |
|
152 ## |
|
153 ## @item Octave:neg-dim-as-zero |
|
154 ## If the @code{Octave:neg-dim-as-zero} warning is enabled, print a warning |
|
155 ## for expressions like |
|
156 ## |
|
157 ## @example |
|
158 ## eye (-1) |
|
159 ## @end example |
|
160 ## |
|
161 ## @noindent |
|
162 ## By default, the @code{Octave:neg-dim-as-zero} warning is disabled. |
|
163 ## |
|
164 ## @item Octave:num-to-str |
|
165 ## If the @code{Octave:num-to-str} warning is enable, a warning is |
|
166 ## printed for implicit conversions of numbers to their ASCII character |
|
167 ## equivalents when strings are constructed using a mixture of strings and |
|
168 ## numbers in matrix notation. For example, |
|
169 ## |
|
170 ## @example |
|
171 ## @group |
|
172 ## [ "f", 111, 111 ] |
|
173 ## @result{} "foo" |
|
174 ## @end group |
|
175 ## @end example |
|
176 ## elicits a warning if the @code{Octave:num-to-str} warning is |
|
177 ## enabled. By default, the @code{Octave:num-to-str} warning is enabled. |
|
178 ## |
|
179 ## @item Octave:precedence-change |
|
180 ## If the @code{Octave:precedence-change} warning is enabled, Octave |
|
181 ## will warn about possible changes in the meaning of some code due to |
|
182 ## changes in precedence for some operators. Precedence changes have |
6555
|
183 ## typically been made for @sc{Matlab} compatibility. By default, the |
5781
|
184 ## @code{Octave:precedence-change} warning is enabled. |
|
185 ## |
|
186 ## @item Octave:reload-forces-clear |
|
187 ## If several functions have been loaded from the same file, Octave must |
|
188 ## clear all the functions before any one of them can be reloaded. If |
|
189 ## the @code{Octave:reload-forces-clear} warning is enabled, Octave will |
|
190 ## warn you when this happens, and print a list of the additional |
|
191 ## functions that it is forced to clear. By default, the |
|
192 ## @code{Octave:reload-forces-clear} warning is enabled. |
|
193 ## |
|
194 ## @item Octave:resize-on-range-error |
|
195 ## If the @code{Octave:resize-on-range-error} warning is enabled, print a |
|
196 ## warning when a matrix is resized by an indexed assignment with |
|
197 ## indices outside the current bounds. By default, the |
|
198 ## @code{Octave:resize-on-range-error} warning is disabled. |
|
199 ## |
5794
|
200 ## @item Octave:separator-insert |
|
201 ## Print warning if commas or semicolons might be inserted |
|
202 ## automatically in literal matrices. |
|
203 ## |
|
204 ## @item Octave:single-quote-string |
|
205 ## Print warning if a signle quote character is used to introduce a |
|
206 ## string constant. |
|
207 ## |
5781
|
208 ## @item Octave:str-to-num |
|
209 ## If the @code{Octave:str-to-num} warning is enabled, a warning is printed |
|
210 ## for implicit conversions of strings to their numeric ASCII equivalents. |
|
211 ## For example, |
|
212 ## @example |
|
213 ## @group |
|
214 ## "abc" + 0 |
|
215 ## @result{} 97 98 99 |
|
216 ## @end group |
|
217 ## @end example |
|
218 ## elicits a warning if the @code{Octave:str-to-num} warning is enabled. |
|
219 ## By default, the @code{Octave:str-to-num} warning is disabled. |
|
220 ## |
|
221 ## @item Octave:string-concat |
|
222 ## If the @code{Octave:string-concat} warning is enabled, print a |
|
223 ## warning when concatenating a mixture of double and single quoted strings. |
|
224 ## By default, the @code{Octave:string-concat} warning is disabled. |
|
225 ## |
|
226 ## @item Octave:undefined-return-values |
|
227 ## If the @code{Octave:undefined-return-values} warning is disabled, |
|
228 ## print a warning if a function does not define all the values in |
|
229 ## the return list which are expected. By default, the |
|
230 ## @code{Octave:undefined-return-values} warning is enabled. |
|
231 ## |
|
232 ## @item Octave:variable-switch-label |
|
233 ## If the @code{Octave:variable-switch-label} warning is enabled, Octave |
|
234 ## will print a warning if a switch label is not a constant or constant |
|
235 ## expression. By default, the @code{Octave:variable-switch-label} |
|
236 ## warning is disabled. |
|
237 ## @end table |