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