$warn: what changed
Revision 0 to 1. Removed lines have a minus sign; added lines have a plus sign.
Title: $warn
| Old | New | Line | |
|---|---|---|---|
| 1 | + | ``` pascal | |
| 2 | + | {$warn} | |
| 3 | + | ``` | |
| 4 | + | ||
| 5 | + | is a [[local compiler directives|local compiler directive]] controlling emission of certain messages during compile-time. Messages do not necessarily have to be warnings, but can be messages of any kind. The directive may also promote specific messages to errors. | |
| 6 | + | ||
| 7 | + | The (local) compiler directives | |
| 8 | + | ||
| 9 | + | ``` pascal | |
| 10 | + | {$warnings on} | |
| 11 | + | ``` | |
| 12 | + | ||
| 13 | + | and | |
| 14 | + | ||
| 15 | + | ``` pascal | |
| 16 | + | {$warnings off} | |
| 17 | + | ``` | |
| 18 | + | ||
| 19 | + | may turn on or off emission of all *warnings* all together. | |
| 20 | + | ||
| 21 | + | ## usage | |
| 22 | + | ||
| 23 | + | ``` pascal | |
| 24 | + | {$warn} | |
| 25 | + | ``` | |
| 26 | + | ||
| 27 | + | requires a message label and a treatment option as arguments, like this: | |
| 28 | + | ||
| 29 | + | ``` pascal | |
| 30 | + | {$warn 3250 off} | |
| 31 | + | ``` | |
| 32 | + | ||
| 33 | + | The numeric message label can be retrieved during compilation with the | |
| 34 | + | ||
| 35 | + | ``` bash | |
| 36 | + | -vq | |
| 37 | + | ``` | |
| 38 | + | ||
| 39 | + | option supplied on the command-line (verbosity: show message numbers). Some messages and groups of messages have an alias, too, which can be seen in the table below. | |
| 40 | + | ||
| 41 | + | Beside | |
| 42 | + | ||
| 43 | + | ``` pascal | |
| 44 | + | {$warn 3019 on} | |
| 45 | + | ``` | |
| 46 | + | ||
| 47 | + | or | |
| 48 | + | ||
| 49 | + | ``` pascal | |
| 50 | + | {$warn 3019 off} | |
| 51 | + | ``` | |
| 52 | + | ||
| 53 | + | and the shorthand notation | |
| 54 | + | ||
| 55 | + | ``` pascal | |
| 56 | + | {$warn 3019 +} | |
| 57 | + | ``` | |
| 58 | + | ||
| 59 | + | and | |
| 60 | + | ||
| 61 | + | ``` pascal | |
| 62 | + | {$warn 3019 -} | |
| 63 | + | ``` | |
| 64 | + | ||
| 65 | + | respectively, | |
| 66 | + | ||
| 67 | + | ``` pascal | |
| 68 | + | {$warn} | |
| 69 | + | ``` | |
| 70 | + | ||
| 71 | + | may be used to promote messages to errors. | |
| 72 | + | ||
| 73 | + | ``` pascal | |
| 74 | + | {$warn symbol_experimental error} | |
| 75 | + | ``` | |
| 76 | + | ||
| 77 | + | will make all, if any, \[\[Hint Directives\|hints concerning | |
| 78 | + | ||
| 79 | + | ```delphi | |
| 80 | + | experimental | |
| 81 | + | ``` | |
| 82 | + | ||
| 83 | + | symbols\]\] become (non-fatal) errors. Depending on the selected error treatment, the compiler may stop compiling or continue, unless a threshold of errors has been reached. | |
| 84 | + | ||
| 85 | + | Note, demoting messages to errors is not possible. A | |
| 86 | + | ||
| 87 | + | ``` pascal | |
| 88 | + | {$fatal} | |
| 89 | + | ``` | |
| 90 | + | ||
| 91 | + | error will always be fatal. | |
| 92 | + | ||
| 93 | + | ## message labels | |
| 94 | + | ||
| 95 | + | <table> | |
| 96 | + | <caption>[[FPC]] messages (excerpt)</caption> | |
| 97 | + | <thead> | |
| 98 | + | <tr> | |
| 99 | + | <th><p>index</p></th> | |
| 100 | + | <th><p>alias</p></th> | |
| 101 | + | <th><p>situations triggering the message</p></th> | |
| 102 | + | </tr> | |
| 103 | + | </thead> | |
| 104 | + | <tbody> | |
| 105 | + | <tr> | |
| 106 | + | <td><div class="sourceCode" id="cb1"><pre class="sourceCode pascal"><code class="sourceCode pascal"><span id="cb1-1"><a href="#cb1-1" aria-hidden="true" tabindex="-1"></a><span class="dv">02024</span></span></code></pre></div></td> | |
| 107 | + | <td></td> | |
| 108 | + | <td><ul> | |
| 109 | + | <li>there is a custom defined | |
| 110 | + | <div class="sourceCode" id="cb2"><pre class="sourceCode pascal"><code class="sourceCode pascal"><span id="cb2-1"><a href="#cb2-1" aria-hidden="true" tabindex="-1"></a><span class="ot">{$warning}</span></span></code></pre></div></li> | |
| 111 | + | </ul></td> | |
| 112 | + | </tr> | |
| 113 | + | <tr> | |
| 114 | + | <td><div class="sourceCode" id="cb3"><pre class="sourceCode pascal"><code class="sourceCode pascal"><span id="cb3-1"><a href="#cb3-1" aria-hidden="true" tabindex="-1"></a><span class="dv">02077</span></span></code></pre></div></td> | |
| 115 | + | <td></td> | |
| 116 | + | <td><ul> | |
| 117 | + | <li>the directive | |
| 118 | + | <div class="sourceCode" id="cb4"><pre class="sourceCode pascal"><code class="sourceCode pascal"><span id="cb4-1"><a href="#cb4-1" aria-hidden="true" tabindex="-1"></a><span class="ot">{$minStackSize}</span></span></code></pre></div> | |
| 119 | + | <p>is used, but not supported on the current OS</p></li> | |
| 120 | + | </ul></td> | |
| 121 | + | </tr> | |
| 122 | + | <tr> | |
| 123 | + | <td><div class="sourceCode" id="cb5"><pre class="sourceCode pascal"><code class="sourceCode pascal"><span id="cb5-1"><a href="#cb5-1" aria-hidden="true" tabindex="-1"></a><span class="dv">02078</span></span></code></pre></div></td> | |
| 124 | + | <td></td> | |
| 125 | + | <td><ul> | |
| 126 | + | <li>the directive | |
| 127 | + | <div class="sourceCode" id="cb6"><pre class="sourceCode pascal"><code class="sourceCode pascal"><span id="cb6-1"><a href="#cb6-1" aria-hidden="true" tabindex="-1"></a><span class="ot">{$maxStackSize}</span></span></code></pre></div> | |
| 128 | + | <p>is used, but not supported on the current OS</p></li> | |
| 129 | + | </ul></td> | |
| 130 | + | </tr> | |
| 131 | + | <tr> | |
| 132 | + | <td><div class="sourceCode" id="cb7"><pre class="sourceCode pascal"><code class="sourceCode pascal"><span id="cb7-1"><a href="#cb7-1" aria-hidden="true" tabindex="-1"></a><span class="dv">03018</span></span></code></pre></div></td> | |
| 133 | + | <td></td> | |
| 134 | + | <td><ul> | |
| 135 | + | <li>a | |
| 136 | + | <pre class="delphi"><code>constructor</code></pre> | |
| 137 | + | <p>is not defined at</p> | |
| 138 | + | <pre class="delphi"><code>public</code></pre> | |
| 139 | + | <p>visibility level</p></li> | |
| 140 | + | </ul></td> | |
| 141 | + | </tr> | |
| 142 | + | <tr> | |
| 143 | + | <td><div class="sourceCode" id="cb10"><pre class="sourceCode pascal"><code class="sourceCode pascal"><span id="cb10-1"><a href="#cb10-1" aria-hidden="true" tabindex="-1"></a><span class="dv">03019</span></span></code></pre></div></td> | |
| 144 | + | <td></td> | |
| 145 | + | <td><ul> | |
| 146 | + | <li>a | |
| 147 | + | <pre class="delphi"><code>destructor</code></pre> | |
| 148 | + | <p>is not defined at</p> | |
| 149 | + | <pre class="delphi"><code>public</code></pre> | |
| 150 | + | <p>visibility level</p></li> | |
| 151 | + | </ul></td> | |
| 152 | + | </tr> | |
| 153 | + | <tr> | |
| 154 | + | <td><div class="sourceCode" id="cb13"><pre class="sourceCode pascal"><code class="sourceCode pascal"><span id="cb13-1"><a href="#cb13-1" aria-hidden="true" tabindex="-1"></a><span class="dv">03177</span></span></code></pre></div></td> | |
| 155 | + | <td></td> | |
| 156 | + | <td><ul> | |
| 157 | + | <li>a | |
| 158 | + | <div class="sourceCode" id="cb14"><pre class="sourceCode pascal"><code class="sourceCode pascal"><span id="cb14-1"><a href="#cb14-1" aria-hidden="true" tabindex="-1"></a><span class="kw">record</span></span></code></pre></div> | |
| 159 | + | <p>initialization does not define values for all fields</p></li> | |
| 160 | + | </ul></td> | |
| 161 | + | </tr> | |
| 162 | + | <tr> | |
| 163 | + | <td><div class="sourceCode" id="cb15"><pre class="sourceCode pascal"><code class="sourceCode pascal"><span id="cb15-1"><a href="#cb15-1" aria-hidden="true" tabindex="-1"></a><span class="dv">03211</span></span></code></pre></div></td> | |
| 164 | + | <td><div class="sourceCode" id="cb16"><pre class="sourceCode pascal"><code class="sourceCode pascal"><span id="cb16-1"><a href="#cb16-1" aria-hidden="true" tabindex="-1"></a>implicit_variants</span></code></pre></div></td> | |
| 165 | + | <td><ul> | |
| 166 | + | <li>the | |
| 167 | + | <div class="sourceCode" id="cb17"><pre class="sourceCode pascal"><code class="sourceCode pascal"><span id="cb17-1"><a href="#cb17-1" aria-hidden="true" tabindex="-1"></a>variants</span></code></pre></div> | |
| 168 | + | <p>unit is required, but has not yet been loaded</p></li> | |
| 169 | + | </ul></td> | |
| 170 | + | </tr> | |
| 171 | + | <tr> | |
| 172 | + | <td><div class="sourceCode" id="cb18"><pre class="sourceCode pascal"><code class="sourceCode pascal"><span id="cb18-1"><a href="#cb18-1" aria-hidden="true" tabindex="-1"></a><span class="dv">03250</span></span></code></pre></div></td> | |
| 173 | + | <td></td> | |
| 174 | + | <td><ul> | |
| 175 | + | <li>a virtual method is overridden with lower visibility</li> | |
| 176 | + | </ul></td> | |
| 177 | + | </tr> | |
| 178 | + | <tr> | |
| 179 | + | <td><div class="sourceCode" id="cb19"><pre class="sourceCode pascal"><code class="sourceCode pascal"><span id="cb19-1"><a href="#cb19-1" aria-hidden="true" tabindex="-1"></a><span class="dv">04044</span></span></code></pre></div></td> | |
| 180 | + | <td></td> | |
| 181 | + | <td><ul> | |
| 182 | + | <li>a comparison might be always | |
| 183 | + | <div class="sourceCode" id="cb20"><pre class="sourceCode pascal"><code class="sourceCode pascal"><span id="cb20-1"><a href="#cb20-1" aria-hidden="true" tabindex="-1"></a><span class="kw">false</span></span></code></pre></div> | |
| 184 | + | <p>(disjunct ranges)</p></li> | |
| 185 | + | </ul></td> | |
| 186 | + | </tr> | |
| 187 | + | <tr> | |
| 188 | + | <td><div class="sourceCode" id="cb21"><pre class="sourceCode pascal"><code class="sourceCode pascal"><span id="cb21-1"><a href="#cb21-1" aria-hidden="true" tabindex="-1"></a><span class="dv">04045</span></span></code></pre></div></td> | |
| 189 | + | <td></td> | |
| 190 | + | <td><ul> | |
| 191 | + | <li>a comparison might be always | |
| 192 | + | <div class="sourceCode" id="cb22"><pre class="sourceCode pascal"><code class="sourceCode pascal"><span id="cb22-1"><a href="#cb22-1" aria-hidden="true" tabindex="-1"></a><span class="kw">true</span></span></code></pre></div> | |
| 193 | + | <p>(disjunct ranges)</p></li> | |
| 194 | + | </ul></td> | |
| 195 | + | </tr> | |
| 196 | + | <tr> | |
| 197 | + | <td><div class="sourceCode" id="cb23"><pre class="sourceCode pascal"><code class="sourceCode pascal"><span id="cb23-1"><a href="#cb23-1" aria-hidden="true" tabindex="-1"></a><span class="dv">04046</span></span></code></pre></div></td> | |
| 198 | + | <td><div class="sourceCode" id="cb24"><pre class="sourceCode pascal"><code class="sourceCode pascal"><span id="cb24-1"><a href="#cb24-1" aria-hidden="true" tabindex="-1"></a>constructing_abstract</span></code></pre></div></td> | |
| 199 | + | <td><ul> | |
| 200 | + | <li>constructing an instance of a class with abstract methods</li> | |
| 201 | + | </ul></td> | |
| 202 | + | </tr> | |
| 203 | + | <tr> | |
| 204 | + | <td><div class="sourceCode" id="cb25"><pre class="sourceCode pascal"><code class="sourceCode pascal"><span id="cb25-1"><a href="#cb25-1" aria-hidden="true" tabindex="-1"></a><span class="dv">04056</span></span></code></pre></div></td> | |
| 205 | + | <td></td> | |
| 206 | + | <td><ul> | |
| 207 | + | <li>a pointer to ordinal conversion is not portable</li> | |
| 208 | + | </ul></td> | |
| 209 | + | </tr> | |
| 210 | + | <tr> | |
| 211 | + | <td><div class="sourceCode" id="cb26"><pre class="sourceCode pascal"><code class="sourceCode pascal"><span id="cb26-1"><a href="#cb26-1" aria-hidden="true" tabindex="-1"></a><span class="dv">04090</span></span></code></pre></div></td> | |
| 212 | + | <td><div class="sourceCode" id="cb27"><pre class="sourceCode pascal"><code class="sourceCode pascal"><span id="cb27-1"><a href="#cb27-1" aria-hidden="true" tabindex="-1"></a>zero_nil_compat</span></code></pre></div></td> | |
| 213 | + | <td><ul> | |
| 214 | + | <li>converting | |
| 215 | + | <div class="sourceCode" id="cb28"><pre class="sourceCode pascal"><code class="sourceCode pascal"><span id="cb28-1"><a href="#cb28-1" aria-hidden="true" tabindex="-1"></a><span class="dv">0</span></span></code></pre></div> | |
| 216 | + | <p>to [[Nil|</p> | |
| 217 | + | <div class="sourceCode" id="cb29"><pre class="sourceCode pascal"><code class="sourceCode pascal"><span id="cb29-1"><a href="#cb29-1" aria-hidden="true" tabindex="-1"></a><span class="kw">nil</span></span></code></pre></div> | |
| 218 | + | <p>]] (integer to pointer)</p></li> | |
| 219 | + | </ul></td> | |
| 220 | + | </tr> | |
| 221 | + | <tr> | |
| 222 | + | <td><div class="sourceCode" id="cb30"><pre class="sourceCode pascal"><code class="sourceCode pascal"><span id="cb30-1"><a href="#cb30-1" aria-hidden="true" tabindex="-1"></a><span class="dv">04104</span></span></code></pre></div></td> | |
| 223 | + | <td><div class="sourceCode" id="cb31"><pre class="sourceCode pascal"><code class="sourceCode pascal"><span id="cb31-1"><a href="#cb31-1" aria-hidden="true" tabindex="-1"></a>implicit_string_cast</span></code></pre></div></td> | |
| 224 | + | <td><ul> | |
| 225 | + | <li>implicit string type conversion</li> | |
| 226 | + | </ul></td> | |
| 227 | + | </tr> | |
| 228 | + | <tr> | |
| 229 | + | <td><div class="sourceCode" id="cb32"><pre class="sourceCode pascal"><code class="sourceCode pascal"><span id="cb32-1"><a href="#cb32-1" aria-hidden="true" tabindex="-1"></a><span class="dv">04105</span></span></code></pre></div></td> | |
| 230 | + | <td><div class="sourceCode" id="cb33"><pre class="sourceCode pascal"><code class="sourceCode pascal"><span id="cb33-1"><a href="#cb33-1" aria-hidden="true" tabindex="-1"></a>implicit_string_cast_loss</span></code></pre></div></td> | |
| 231 | + | <td><ul> | |
| 232 | + | <li>implicit string type conversion with potential data loss</li> | |
| 233 | + | </ul></td> | |
| 234 | + | </tr> | |
| 235 | + | <tr> | |
| 236 | + | <td><div class="sourceCode" id="cb34"><pre class="sourceCode pascal"><code class="sourceCode pascal"><span id="cb34-1"><a href="#cb34-1" aria-hidden="true" tabindex="-1"></a><span class="dv">04106</span></span></code></pre></div></td> | |
| 237 | + | <td><div class="sourceCode" id="cb35"><pre class="sourceCode pascal"><code class="sourceCode pascal"><span id="cb35-1"><a href="#cb35-1" aria-hidden="true" tabindex="-1"></a>explicit_string_cast</span></code></pre></div></td> | |
| 238 | + | <td><ul> | |
| 239 | + | <li>explicit string type conversion</li> | |
| 240 | + | </ul></td> | |
| 241 | + | </tr> | |
| 242 | + | <tr> | |
| 243 | + | <td><div class="sourceCode" id="cb36"><pre class="sourceCode pascal"><code class="sourceCode pascal"><span id="cb36-1"><a href="#cb36-1" aria-hidden="true" tabindex="-1"></a><span class="dv">04107</span></span></code></pre></div></td> | |
| 244 | + | <td><div class="sourceCode" id="cb37"><pre class="sourceCode pascal"><code class="sourceCode pascal"><span id="cb37-1"><a href="#cb37-1" aria-hidden="true" tabindex="-1"></a>explicit_string_cast_loss</span></code></pre></div></td> | |
| 245 | + | <td><ul> | |
| 246 | + | <li>explicit string type conversion with potential data loss</li> | |
| 247 | + | </ul></td> | |
| 248 | + | </tr> | |
| 249 | + | <tr> | |
| 250 | + | <td><div class="sourceCode" id="cb38"><pre class="sourceCode pascal"><code class="sourceCode pascal"><span id="cb38-1"><a href="#cb38-1" aria-hidden="true" tabindex="-1"></a><span class="dv">04108</span></span></code></pre></div></td> | |
| 251 | + | <td><div class="sourceCode" id="cb39"><pre class="sourceCode pascal"><code class="sourceCode pascal"><span id="cb39-1"><a href="#cb39-1" aria-hidden="true" tabindex="-1"></a>cvt_narrowing_string_lost</span></code></pre></div></td> | |
| 252 | + | <td><ul> | |
| 253 | + | <li>Unicode constant cast with potential data loss</li> | |
| 254 | + | </ul></td> | |
| 255 | + | </tr> | |
| 256 | + | <tr> | |
| 257 | + | <td><div class="sourceCode" id="cb40"><pre class="sourceCode pascal"><code class="sourceCode pascal"><span id="cb40-1"><a href="#cb40-1" aria-hidden="true" tabindex="-1"></a><span class="dv">04116</span></span></code></pre></div></td> | |
| 258 | + | <td><div class="sourceCode" id="cb41"><pre class="sourceCode pascal"><code class="sourceCode pascal"><span id="cb41-1"><a href="#cb41-1" aria-hidden="true" tabindex="-1"></a>intf_raise_visibility</span></code></pre></div></td> | |
| 259 | + | <td><ul> | |
| 260 | + | <li>the interface defines a broader visibility for a method</li> | |
| 261 | + | </ul></td> | |
| 262 | + | </tr> | |
| 263 | + | <tr> | |
| 264 | + | <td><div class="sourceCode" id="cb42"><pre class="sourceCode pascal"><code class="sourceCode pascal"><span id="cb42-1"><a href="#cb42-1" aria-hidden="true" tabindex="-1"></a><span class="dv">04122</span></span></code></pre></div></td> | |
| 265 | + | <td><div class="sourceCode" id="cb43"><pre class="sourceCode pascal"><code class="sourceCode pascal"><span id="cb43-1"><a href="#cb43-1" aria-hidden="true" tabindex="-1"></a>constructing_abstract</span></code></pre></div></td> | |
| 266 | + | <td><ul> | |
| 267 | + | <li>constructing an instance of an abstract class</li> | |
| 268 | + | </ul></td> | |
| 269 | + | </tr> | |
| 270 | + | <tr> | |
| 271 | + | <td><div class="sourceCode" id="cb44"><pre class="sourceCode pascal"><code class="sourceCode pascal"><span id="cb44-1"><a href="#cb44-1" aria-hidden="true" tabindex="-1"></a><span class="dv">05023</span></span></code></pre></div></td> | |
| 272 | + | <td></td> | |
| 273 | + | <td><ul> | |
| 274 | + | <li>a | |
| 275 | + | <div class="sourceCode" id="cb45"><pre class="sourceCode pascal"><code class="sourceCode pascal"><span id="cb45-1"><a href="#cb45-1" aria-hidden="true" tabindex="-1"></a><span class="kw">unit</span></span></code></pre></div> | |
| 276 | + | <p>is imported, but not used (except units containing</p> | |
| 277 | + | <div class="sourceCode" id="cb46"><pre class="sourceCode pascal"><code class="sourceCode pascal"><span id="cb46-1"><a href="#cb46-1" aria-hidden="true" tabindex="-1"></a><span class="kw">initialization</span></span></code></pre></div> | |
| 278 | + | <p>/</p> | |
| 279 | + | <div class="sourceCode" id="cb47"><pre class="sourceCode pascal"><code class="sourceCode pascal"><span id="cb47-1"><a href="#cb47-1" aria-hidden="true" tabindex="-1"></a><span class="kw">finalization</span></span></code></pre></div> | |
| 280 | + | <p>code)</p></li> | |
| 281 | + | </ul></td> | |
| 282 | + | </tr> | |
| 283 | + | <tr> | |
| 284 | + | <td><div class="sourceCode" id="cb48"><pre class="sourceCode pascal"><code class="sourceCode pascal"><span id="cb48-1"><a href="#cb48-1" aria-hidden="true" tabindex="-1"></a><span class="dv">05024</span></span></code></pre></div></td> | |
| 285 | + | <td></td> | |
| 286 | + | <td><ul> | |
| 287 | + | <li>a routine parameter remains unused</li> | |
| 288 | + | </ul></td> | |
| 289 | + | </tr> | |
| 290 | + | <tr> | |
| 291 | + | <td><div class="sourceCode" id="cb49"><pre class="sourceCode pascal"><code class="sourceCode pascal"><span id="cb49-1"><a href="#cb49-1" aria-hidden="true" tabindex="-1"></a><span class="dv">05033</span></span></code></pre></div></td> | |
| 292 | + | <td><div class="sourceCode" id="cb50"><pre class="sourceCode pascal"><code class="sourceCode pascal"><span id="cb50-1"><a href="#cb50-1" aria-hidden="true" tabindex="-1"></a>no_retval</span></code></pre></div></td> | |
| 293 | + | <td><ul> | |
| 294 | + | <li>no (for the compiler obvious) assignment to a function’s return value</li> | |
| 295 | + | </ul></td> | |
| 296 | + | </tr> | |
| 297 | + | <tr> | |
| 298 | + | <td><div class="sourceCode" id="cb51"><pre class="sourceCode pascal"><code class="sourceCode pascal"><span id="cb51-1"><a href="#cb51-1" aria-hidden="true" tabindex="-1"></a><span class="dv">05036</span></span></code></pre></div></td> | |
| 299 | + | <td></td> | |
| 300 | + | <td><ul> | |
| 301 | + | <li>a variable which might not yet have been initialized is used</li> | |
| 302 | + | </ul></td> | |
| 303 | + | </tr> | |
| 304 | + | <tr> | |
| 305 | + | <td><div class="sourceCode" id="cb52"><pre class="sourceCode pascal"><code class="sourceCode pascal"><span id="cb52-1"><a href="#cb52-1" aria-hidden="true" tabindex="-1"></a><span class="dv">05043</span></span></code></pre></div></td> | |
| 306 | + | <td><div class="sourceCode" id="cb53"><pre class="sourceCode pascal"><code class="sourceCode pascal"><span id="cb53-1"><a href="#cb53-1" aria-hidden="true" tabindex="-1"></a>symbol_deprecated</span></code></pre></div></td> | |
| 307 | + | <td><ul> | |
| 308 | + | <li>a symbol with the | |
| 309 | + | <pre class="delphi"><code>deprecated</code></pre> | |
| 310 | + | <p>hint (no deprecation message defined) is used</p></li> | |
| 311 | + | </ul></td> | |
| 312 | + | </tr> | |
| 313 | + | <tr> | |
| 314 | + | <td><div class="sourceCode" id="cb55"><pre class="sourceCode pascal"><code class="sourceCode pascal"><span id="cb55-1"><a href="#cb55-1" aria-hidden="true" tabindex="-1"></a><span class="dv">05044</span></span></code></pre></div></td> | |
| 315 | + | <td><div class="sourceCode" id="cb56"><pre class="sourceCode pascal"><code class="sourceCode pascal"><span id="cb56-1"><a href="#cb56-1" aria-hidden="true" tabindex="-1"></a>symbol_platform</span></code></pre></div></td> | |
| 316 | + | <td><ul> | |
| 317 | + | <li>a symbol with the | |
| 318 | + | <pre class="delphi"><code>platform</code></pre> | |
| 319 | + | <p>hint is used</p></li> | |
| 320 | + | </ul></td> | |
| 321 | + | </tr> | |
| 322 | + | <tr> | |
| 323 | + | <td><div class="sourceCode" id="cb58"><pre class="sourceCode pascal"><code class="sourceCode pascal"><span id="cb58-1"><a href="#cb58-1" aria-hidden="true" tabindex="-1"></a><span class="dv">05055</span></span></code></pre></div></td> | |
| 324 | + | <td><div class="sourceCode" id="cb59"><pre class="sourceCode pascal"><code class="sourceCode pascal"><span id="cb59-1"><a href="#cb59-1" aria-hidden="true" tabindex="-1"></a>symbol_unimplemented</span></code></pre></div></td> | |
| 325 | + | <td><ul> | |
| 326 | + | <li>a symbol with the | |
| 327 | + | <pre class="delphi"><code>unimplemented</code></pre> | |
| 328 | + | <p>hint is used</p></li> | |
| 329 | + | </ul></td> | |
| 330 | + | </tr> | |
| 331 | + | <tr> | |
| 332 | + | <td><div class="sourceCode" id="cb61"><pre class="sourceCode pascal"><code class="sourceCode pascal"><span id="cb61-1"><a href="#cb61-1" aria-hidden="true" tabindex="-1"></a><span class="dv">05059</span></span></code></pre></div></td> | |
| 333 | + | <td></td> | |
| 334 | + | <td><ul> | |
| 335 | + | <li>inside a function definition its result variable’s value is used, before it has been initialized</li> | |
| 336 | + | </ul></td> | |
| 337 | + | </tr> | |
| 338 | + | <tr> | |
| 339 | + | <td><div class="sourceCode" id="cb62"><pre class="sourceCode pascal"><code class="sourceCode pascal"><span id="cb62-1"><a href="#cb62-1" aria-hidden="true" tabindex="-1"></a><span class="dv">05063</span></span></code></pre></div></td> | |
| 340 | + | <td><div class="sourceCode" id="cb63"><pre class="sourceCode pascal"><code class="sourceCode pascal"><span id="cb63-1"><a href="#cb63-1" aria-hidden="true" tabindex="-1"></a>symbol_experimental</span></code></pre></div></td> | |
| 341 | + | <td><ul> | |
| 342 | + | <li>a symbol with the | |
| 343 | + | <pre class="delphi"><code>experimental</code></pre> | |
| 344 | + | <p>hint is used</p></li> | |
| 345 | + | </ul></td> | |
| 346 | + | </tr> | |
| 347 | + | <tr> | |
| 348 | + | <td><div class="sourceCode" id="cb65"><pre class="sourceCode pascal"><code class="sourceCode pascal"><span id="cb65-1"><a href="#cb65-1" aria-hidden="true" tabindex="-1"></a><span class="dv">05065</span></span></code></pre></div></td> | |
| 349 | + | <td><div class="sourceCode" id="cb66"><pre class="sourceCode pascal"><code class="sourceCode pascal"><span id="cb66-1"><a href="#cb66-1" aria-hidden="true" tabindex="-1"></a>symbol_library</span></code></pre></div></td> | |
| 350 | + | <td><ul> | |
| 351 | + | <li>a library symbol is used</li> | |
| 352 | + | </ul></td> | |
| 353 | + | </tr> | |
| 354 | + | <tr> | |
| 355 | + | <td><div class="sourceCode" id="cb67"><pre class="sourceCode pascal"><code class="sourceCode pascal"><span id="cb67-1"><a href="#cb67-1" aria-hidden="true" tabindex="-1"></a><span class="dv">05066</span></span></code></pre></div></td> | |
| 356 | + | <td><div class="sourceCode" id="cb68"><pre class="sourceCode pascal"><code class="sourceCode pascal"><span id="cb68-1"><a href="#cb68-1" aria-hidden="true" tabindex="-1"></a>symbol_deprecated</span></code></pre></div></td> | |
| 357 | + | <td><ul> | |
| 358 | + | <li>a symbol with the | |
| 359 | + | <pre class="delphi"><code>deprecated</code></pre> | |
| 360 | + | <p>hint is used and a custom deprecation notice has been defined</p></li> | |
| 361 | + | </ul></td> | |
| 362 | + | </tr> | |
| 363 | + | <tr> | |
| 364 | + | <td><div class="sourceCode" id="cb70"><pre class="sourceCode pascal"><code class="sourceCode pascal"><span id="cb70-1"><a href="#cb70-1" aria-hidden="true" tabindex="-1"></a><span class="dv">05073</span></span></code></pre></div></td> | |
| 365 | + | <td></td> | |
| 366 | + | <td><ul> | |
| 367 | + | <li>a | |
| 368 | + | <pre class="delphi"><code>private property</code></pre> | |
| 369 | + | <p>remains unused</p></li> | |
| 370 | + | </ul></td> | |
| 371 | + | </tr> | |
| 372 | + | <tr> | |
| 373 | + | <td><div class="sourceCode" id="cb72"><pre class="sourceCode pascal"><code class="sourceCode pascal"><span id="cb72-1"><a href="#cb72-1" aria-hidden="true" tabindex="-1"></a><span class="dv">05074</span></span></code></pre></div></td> | |
| 374 | + | <td><div class="sourceCode" id="cb73"><pre class="sourceCode pascal"><code class="sourceCode pascal"><span id="cb73-1"><a href="#cb73-1" aria-hidden="true" tabindex="-1"></a>unit_deprecated</span></code></pre></div></td> | |
| 375 | + | <td><ul> | |
| 376 | + | <li>a unit with the | |
| 377 | + | <pre class="delphi"><code>deprecated</code></pre> | |
| 378 | + | <p>hint (without a custom deprecation message supplied) is used</p></li> | |
| 379 | + | </ul></td> | |
| 380 | + | </tr> | |
| 381 | + | <tr> | |
| 382 | + | <td><div class="sourceCode" id="cb75"><pre class="sourceCode pascal"><code class="sourceCode pascal"><span id="cb75-1"><a href="#cb75-1" aria-hidden="true" tabindex="-1"></a><span class="dv">05075</span></span></code></pre></div></td> | |
| 383 | + | <td><div class="sourceCode" id="cb76"><pre class="sourceCode pascal"><code class="sourceCode pascal"><span id="cb76-1"><a href="#cb76-1" aria-hidden="true" tabindex="-1"></a>unit_deprecated</span></code></pre></div></td> | |
| 384 | + | <td><ul> | |
| 385 | + | <li>a unit with the | |
| 386 | + | <pre class="delphi"><code>deprecated</code></pre> | |
| 387 | + | <p>hint is used and a custom deprecation notice has been defined</p></li> | |
| 388 | + | </ul></td> | |
| 389 | + | </tr> | |
| 390 | + | <tr> | |
| 391 | + | <td><div class="sourceCode" id="cb78"><pre class="sourceCode pascal"><code class="sourceCode pascal"><span id="cb78-1"><a href="#cb78-1" aria-hidden="true" tabindex="-1"></a><span class="dv">05076</span></span></code></pre></div></td> | |
| 392 | + | <td><div class="sourceCode" id="cb79"><pre class="sourceCode pascal"><code class="sourceCode pascal"><span id="cb79-1"><a href="#cb79-1" aria-hidden="true" tabindex="-1"></a>unit_platform</span></code></pre></div></td> | |
| 393 | + | <td><ul> | |
| 394 | + | <li>a unit with the | |
| 395 | + | <pre class="delphi"><code>platform</code></pre> | |
| 396 | + | <p>hint is used</p></li> | |
| 397 | + | </ul></td> | |
| 398 | + | </tr> | |
| 399 | + | <tr> | |
| 400 | + | <td><div class="sourceCode" id="cb81"><pre class="sourceCode pascal"><code class="sourceCode pascal"><span id="cb81-1"><a href="#cb81-1" aria-hidden="true" tabindex="-1"></a><span class="dv">05077</span></span></code></pre></div></td> | |
| 401 | + | <td><div class="sourceCode" id="cb82"><pre class="sourceCode pascal"><code class="sourceCode pascal"><span id="cb82-1"><a href="#cb82-1" aria-hidden="true" tabindex="-1"></a>unit_library</span></code></pre></div></td> | |
| 402 | + | <td><ul> | |
| 403 | + | <li>[to be explained]</li> | |
| 404 | + | </ul></td> | |
| 405 | + | </tr> | |
| 406 | + | <tr> | |
| 407 | + | <td><div class="sourceCode" id="cb83"><pre class="sourceCode pascal"><code class="sourceCode pascal"><span id="cb83-1"><a href="#cb83-1" aria-hidden="true" tabindex="-1"></a><span class="dv">05078</span></span></code></pre></div></td> | |
| 408 | + | <td><div class="sourceCode" id="cb84"><pre class="sourceCode pascal"><code class="sourceCode pascal"><span id="cb84-1"><a href="#cb84-1" aria-hidden="true" tabindex="-1"></a>unit_unimplemented</span></code></pre></div></td> | |
| 409 | + | <td><ul> | |
| 410 | + | <li>a unit with the | |
| 411 | + | <pre class="delphi"><code>unimplemented</code></pre> | |
| 412 | + | <p>hint is used</p></li> | |
| 413 | + | </ul></td> | |
| 414 | + | </tr> | |
| 415 | + | <tr> | |
| 416 | + | <td><div class="sourceCode" id="cb86"><pre class="sourceCode pascal"><code class="sourceCode pascal"><span id="cb86-1"><a href="#cb86-1" aria-hidden="true" tabindex="-1"></a><span class="dv">05079</span></span></code></pre></div></td> | |
| 417 | + | <td><div class="sourceCode" id="cb87"><pre class="sourceCode pascal"><code class="sourceCode pascal"><span id="cb87-1"><a href="#cb87-1" aria-hidden="true" tabindex="-1"></a>unit_experimental</span></code></pre></div></td> | |
| 418 | + | <td><ul> | |
| 419 | + | <li>a unit with the | |
| 420 | + | <pre class="delphi"><code>experimental</code></pre> | |
| 421 | + | <p>hint is used</p></li> | |
| 422 | + | </ul></td> | |
| 423 | + | </tr> | |
| 424 | + | <tr> | |
| 425 | + | <td><div class="sourceCode" id="cb89"><pre class="sourceCode pascal"><code class="sourceCode pascal"><span id="cb89-1"><a href="#cb89-1" aria-hidden="true" tabindex="-1"></a><span class="dv">06018</span></span></code></pre></div></td> | |
| 426 | + | <td></td> | |
| 427 | + | <td><ul> | |
| 428 | + | <li>the compiler has determined there is, or might be, unreachable code</li> | |
| 429 | + | </ul></td> | |
| 430 | + | </tr> | |
| 431 | + | <tr> | |
| 432 | + | <td><div class="sourceCode" id="cb90"><pre class="sourceCode pascal"><code class="sourceCode pascal"><span id="cb90-1"><a href="#cb90-1" aria-hidden="true" tabindex="-1"></a><span class="dv">07104</span></span></code></pre></div></td> | |
| 433 | + | <td></td> | |
| 434 | + | <td><ul> | |
| 435 | + | <li>register indirect addressing with | |
| 436 | + | <div class="sourceCode" id="cb91"><pre class="sourceCode asm"><code class="sourceCode fasm"><span id="cb91-1"><a href="#cb91-1" aria-hidden="true" tabindex="-1"></a>ebp</span></code></pre></div> | |
| 437 | + | <p>is used in conjunction with a negative offset</p></li> | |
| 438 | + | </ul></td> | |
| 439 | + | </tr> | |
| 440 | + | </tbody> | |
| 441 | + | </table> | |
| 442 | + | ||
| 443 | + | Note, some aliases identify *multiple* messages. | |
| 444 | + | ||
| 445 | + | ## see also | |
| 446 | + | ||
| 447 | + | - \[<https://www.freepascal.org/docs-html/prog/progsu80.html> § “ | |
| 448 | + | ```text | |
| 449 | + | $WARN | |
| 450 | + | ``` | |
| 451 | + | ||
| 452 | + | ||
| 453 | + | Control emission of warnings” in the *Free Pascal programmer’s guide*\] | |
| 454 | + | - \[\[\$message\| | |
| 455 | + | ``` pascal | |
| 456 | + | {$message} | |
| 457 | + | ``` | |
| 458 | + | ||
| 459 | + | \]\] | |
| 460 | + | - [[Turn warnings and hints on or off]] | |
| 461 | + | ||
| 462 | + | --- | |
| 463 | + | *From the Free Pascal wiki, page "$warn", as it stood on 2022-09-07 after a change by Kai Burghardt, out of the wiki's dump of 2024-05-26. Copyright stays with the author who wrote it, according to the old wiki's [[Licensing]] page. If you have concerns about this material, [message the admin](/wiki-contact).* | |
| 464 | + | Category: FPC | |
| 465 | + | Category: Local compiler directives |
