| 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 | | - | ``` |
| 1 | + | `{$warn}` 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. |
| 18 | 2 | | |
| 19 | | - | may turn on or off emission of all *warnings* all together. |
| 3 | + | The (local) compiler directives `{$warnings on}` and `{$warnings off}` may turn on or off emission of all *warnings* all together. |
| 20 | 4 | | |
| 21 | 5 | | ## usage |
| 22 | 6 | | |
| 23 | | - | ``` pascal |
| 24 | | - | {$warn} |
| 25 | | - | ``` |
| 26 | | - | |
| 27 | | - | requires a message label and a treatment option as arguments, like this: |
| 7 | + | `{$warn}` requires a message label and a treatment option as arguments, like this: |
| 28 | 8 | | |
| 29 | 9 | | ``` pascal |
| 30 | 10 | | {$warn 3250 off} |
| 31 | 11 | | ``` |
| 32 | 12 | | |
| 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 |
| 13 | + | The numeric message label can be retrieved during compilation with the `-vq` 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. |
| 86 | 14 | | |
| 87 | | - | ``` pascal |
| 88 | | - | {$fatal} |
| 89 | | - | ``` |
| 15 | + | Beside `{$warn 3019 on}` or `{$warn 3019 off}` and the shorthand notation `{$warn 3019 +}` and `{$warn 3019 -}` respectively, `{$warn}` may be used to promote messages to errors. `{$warn symbol_experimental error}` will make all, if any, [[Hint Directives|hints concerning experimental 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. |
| 90 | 16 | | |
| 91 | | - | error will always be fatal. |
| 17 | + | Note, demoting messages to errors is not possible. A `{$fatal}` error will always be fatal. |
| 92 | 18 | | |
| 93 | 19 | | ## message labels |
| 94 | 20 | | |
| 95 | 21 | | <table> |
| 96 | 22 | | <caption>[[FPC]] messages (excerpt)</caption> |
| 97 | 23 | | <thead> |
| 98 | 24 | | <tr> |
| 99 | 25 | | <th><p>index</p></th> |
| 100 | 26 | | <th><p>alias</p></th> |
| 101 | 27 | | <th><p>situations triggering the message</p></th> |
| 102 | 28 | | </tr> |
| 103 | 29 | | </thead> |
| 104 | 30 | | <tbody> |
| 105 | 31 | | <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> |
| 32 | + | <td><p><code>02024</code></p></td> |
| 107 | 33 | | <td></td> |
| 108 | 34 | | <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> |
| 35 | + | <li>there is a custom defined <code>{$warning}</code></li> |
| 111 | 36 | | </ul></td> |
| 112 | 37 | | </tr> |
| 113 | 38 | | <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> |
| 39 | + | <td><p><code>02077</code></p></td> |
| 115 | 40 | | <td></td> |
| 116 | 41 | | <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> |
| 42 | + | <li>the directive <code>{$minStackSize}</code> is used, but not supported on the current OS</li> |
| 120 | 43 | | </ul></td> |
| 121 | 44 | | </tr> |
| 122 | 45 | | <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> |
| 46 | + | <td><p><code>02078</code></p></td> |
| 124 | 47 | | <td></td> |
| 125 | 48 | | <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> |
| 49 | + | <li>the directive <code>{$maxStackSize}</code> is used, but not supported on the current OS</li> |
| 129 | 50 | | </ul></td> |
| 130 | 51 | | </tr> |
| 131 | 52 | | <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> |
| 53 | + | <td><p><code>03018</code></p></td> |
| 133 | 54 | | <td></td> |
| 134 | 55 | | <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> |
| 56 | + | <li>a <code>constructor</code> is not defined at <code>public</code> visibility level</li> |
| 140 | 57 | | </ul></td> |
| 141 | 58 | | </tr> |
| 142 | 59 | | <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> |
| 60 | + | <td><p><code>03019</code></p></td> |
| 144 | 61 | | <td></td> |
| 145 | 62 | | <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> |
| 63 | + | <li>a <code>destructor</code> is not defined at <code>public</code> visibility level</li> |
| 151 | 64 | | </ul></td> |
| 152 | 65 | | </tr> |
| 153 | 66 | | <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> |
| 67 | + | <td><p><code>03177</code></p></td> |
| 155 | 68 | | <td></td> |
| 156 | 69 | | <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> |
| 70 | + | <li>a <code>record</code> initialization does not define values for all fields</li> |
| 160 | 71 | | </ul></td> |
| 161 | 72 | | </tr> |
| 162 | 73 | | <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> |
| 74 | + | <td><p><code>03211</code></p></td> |
| 75 | + | <td><p><code>implicit_variants</code></p></td> |
| 165 | 76 | | <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> |
| 77 | + | <li>the <code>variants</code> unit is required, but has not yet been loaded</li> |
| 169 | 78 | | </ul></td> |
| 170 | 79 | | </tr> |
| 171 | 80 | | <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> |
| 81 | + | <td><p><code>03250</code></p></td> |
| 173 | 82 | | <td></td> |
| 174 | 83 | | <td><ul> |
| 175 | 84 | | <li>a virtual method is overridden with lower visibility</li> |
| 176 | 85 | | </ul></td> |
| 177 | 86 | | </tr> |
| 178 | 87 | | <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> |
| 88 | + | <td><p><code>04044</code></p></td> |
| 180 | 89 | | <td></td> |
| 181 | 90 | | <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> |
| 91 | + | <li>a comparison might be always <code>false</code> (disjunct ranges)</li> |
| 185 | 92 | | </ul></td> |
| 186 | 93 | | </tr> |
| 187 | 94 | | <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> |
| 95 | + | <td><p><code>04045</code></p></td> |
| 189 | 96 | | <td></td> |
| 190 | 97 | | <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> |
| 98 | + | <li>a comparison might be always <code>true</code> (disjunct ranges)</li> |
| 194 | 99 | | </ul></td> |
| 195 | 100 | | </tr> |
| 196 | 101 | | <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> |
| 102 | + | <td><p><code>04046</code></p></td> |
| 103 | + | <td><p><code>constructing_abstract</code></p></td> |
| 199 | 104 | | <td><ul> |
| 200 | 105 | | <li>constructing an instance of a class with abstract methods</li> |
| 201 | 106 | | </ul></td> |
| 202 | 107 | | </tr> |
| 203 | 108 | | <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> |
| 109 | + | <td><p><code>04056</code></p></td> |
| 205 | 110 | | <td></td> |
| 206 | 111 | | <td><ul> |
| 207 | 112 | | <li>a pointer to ordinal conversion is not portable</li> |
| 208 | 113 | | </ul></td> |
| 209 | 114 | | </tr> |
| 210 | 115 | | <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> |
| 116 | + | <td><p><code>04090</code></p></td> |
| 117 | + | <td><p><code>zero_nil_compat</code></p></td> |
| 213 | 118 | | <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> |
| 119 | + | <li>converting <code>0</code> to [[Nil|nil]] (integer to pointer)</li> |
| 219 | 120 | | </ul></td> |
| 220 | 121 | | </tr> |
| 221 | 122 | | <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> |
| 123 | + | <td><p><code>04104</code></p></td> |
| 124 | + | <td><p><code>implicit_string_cast</code></p></td> |
| 224 | 125 | | <td><ul> |
| 225 | 126 | | <li>implicit string type conversion</li> |
| 226 | 127 | | </ul></td> |
| 227 | 128 | | </tr> |
| 228 | 129 | | <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> |
| 130 | + | <td><p><code>04105</code></p></td> |
| 131 | + | <td><p><code>implicit_string_cast_loss</code></p></td> |
| 231 | 132 | | <td><ul> |
| 232 | 133 | | <li>implicit string type conversion with potential data loss</li> |
| 233 | 134 | | </ul></td> |
| 234 | 135 | | </tr> |
| 235 | 136 | | <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> |
| 137 | + | <td><p><code>04106</code></p></td> |
| 138 | + | <td><p><code>explicit_string_cast</code></p></td> |
| 238 | 139 | | <td><ul> |
| 239 | 140 | | <li>explicit string type conversion</li> |
| 240 | 141 | | </ul></td> |
| 241 | 142 | | </tr> |
| 242 | 143 | | <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> |
| 144 | + | <td><p><code>04107</code></p></td> |
| 145 | + | <td><p><code>explicit_string_cast_loss</code></p></td> |
| 245 | 146 | | <td><ul> |
| 246 | 147 | | <li>explicit string type conversion with potential data loss</li> |
| 247 | 148 | | </ul></td> |
| 248 | 149 | | </tr> |
| 249 | 150 | | <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> |
| 151 | + | <td><p><code>04108</code></p></td> |
| 152 | + | <td><p><code>cvt_narrowing_string_lost</code></p></td> |
| 252 | 153 | | <td><ul> |
| 253 | 154 | | <li>Unicode constant cast with potential data loss</li> |
| 254 | 155 | | </ul></td> |
| 255 | 156 | | </tr> |
| 256 | 157 | | <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> |
| 158 | + | <td><p><code>04116</code></p></td> |
| 159 | + | <td><p><code>intf_raise_visibility</code></p></td> |
| 259 | 160 | | <td><ul> |
| 260 | 161 | | <li>the interface defines a broader visibility for a method</li> |
| 261 | 162 | | </ul></td> |
| 262 | 163 | | </tr> |
| 263 | 164 | | <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> |
| 165 | + | <td><p><code>04122</code></p></td> |
| 166 | + | <td><p><code>constructing_abstract</code></p></td> |
| 266 | 167 | | <td><ul> |
| 267 | 168 | | <li>constructing an instance of an abstract class</li> |
| 268 | 169 | | </ul></td> |
| 269 | 170 | | </tr> |
| 270 | 171 | | <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> |
| 172 | + | <td><p><code>05023</code></p></td> |
| 272 | 173 | | <td></td> |
| 273 | 174 | | <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> |
| 175 | + | <li>a <code>unit</code> is imported, but not used (except units containing <code>initialization</code>/<code>finalization</code> code)</li> |
| 281 | 176 | | </ul></td> |
| 282 | 177 | | </tr> |
| 283 | 178 | | <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> |
| 179 | + | <td><p><code>05024</code></p></td> |
| 285 | 180 | | <td></td> |
| 286 | 181 | | <td><ul> |
| 287 | 182 | | <li>a routine parameter remains unused</li> |
| 288 | 183 | | </ul></td> |
| 289 | 184 | | </tr> |
| 290 | 185 | | <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> |
| 186 | + | <td><p><code>05033</code></p></td> |
| 187 | + | <td><p><code>no_retval</code></p></td> |
| 293 | 188 | | <td><ul> |
| 294 | 189 | | <li>no (for the compiler obvious) assignment to a function’s return value</li> |
| 295 | 190 | | </ul></td> |
| 296 | 191 | | </tr> |
| 297 | 192 | | <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> |
| 193 | + | <td><p><code>05036</code></p></td> |
| 299 | 194 | | <td></td> |
| 300 | 195 | | <td><ul> |
| 301 | 196 | | <li>a variable which might not yet have been initialized is used</li> |
| 302 | 197 | | </ul></td> |
| 303 | 198 | | </tr> |
| 304 | 199 | | <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> |
| 200 | + | <td><p><code>05043</code></p></td> |
| 201 | + | <td><p><code>symbol_deprecated</code></p></td> |
| 307 | 202 | | <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> |
| 203 | + | <li>a symbol with the <code>deprecated</code> hint (no deprecation message defined) is used</li> |
| 311 | 204 | | </ul></td> |
| 312 | 205 | | </tr> |
| 313 | 206 | | <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> |
| 207 | + | <td><p><code>05044</code></p></td> |
| 208 | + | <td><p><code>symbol_platform</code></p></td> |
| 316 | 209 | | <td><ul> |
| 317 | | - | <li>a symbol with the |
| 318 | | - | <pre class="delphi"><code>platform</code></pre> |
| 319 | | - | <p>hint is used</p></li> |
| 210 | + | <li>a symbol with the <code>platform</code> hint is used</li> |
| 320 | 211 | | </ul></td> |
| 321 | 212 | | </tr> |
| 322 | 213 | | <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> |
| 214 | + | <td><p><code>05055</code></p></td> |
| 215 | + | <td><p><code>symbol_unimplemented</code></p></td> |
| 325 | 216 | | <td><ul> |
| 326 | | - | <li>a symbol with the |
| 327 | | - | <pre class="delphi"><code>unimplemented</code></pre> |
| 328 | | - | <p>hint is used</p></li> |
| 217 | + | <li>a symbol with the <code>unimplemented</code> hint is used</li> |
| 329 | 218 | | </ul></td> |
| 330 | 219 | | </tr> |
| 331 | 220 | | <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> |
| 221 | + | <td><p><code>05059</code></p></td> |
| 333 | 222 | | <td></td> |
| 334 | 223 | | <td><ul> |
| 335 | 224 | | <li>inside a function definition its result variable’s value is used, before it has been initialized</li> |
| 336 | 225 | | </ul></td> |
| 337 | 226 | | </tr> |
| 338 | 227 | | <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> |
| 228 | + | <td><p><code>05063</code></p></td> |
| 229 | + | <td><p><code>symbol_experimental</code></p></td> |
| 341 | 230 | | <td><ul> |
| 342 | | - | <li>a symbol with the |
| 343 | | - | <pre class="delphi"><code>experimental</code></pre> |
| 344 | | - | <p>hint is used</p></li> |
| 231 | + | <li>a symbol with the <code>experimental</code> hint is used</li> |
| 345 | 232 | | </ul></td> |
| 346 | 233 | | </tr> |
| 347 | 234 | | <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> |
| 235 | + | <td><p><code>05065</code></p></td> |
| 236 | + | <td><p><code>symbol_library</code></p></td> |
| 350 | 237 | | <td><ul> |
| 351 | 238 | | <li>a library symbol is used</li> |
| 352 | 239 | | </ul></td> |
| 353 | 240 | | </tr> |
| 354 | 241 | | <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> |
| 242 | + | <td><p><code>05066</code></p></td> |
| 243 | + | <td><p><code>symbol_deprecated</code></p></td> |
| 357 | 244 | | <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> |
| 245 | + | <li>a symbol with the <code>deprecated</code> hint is used and a custom deprecation notice has been defined</li> |
| 361 | 246 | | </ul></td> |
| 362 | 247 | | </tr> |
| 363 | 248 | | <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> |
| 249 | + | <td><p><code>05073</code></p></td> |
| 365 | 250 | | <td></td> |
| 366 | 251 | | <td><ul> |
| 367 | | - | <li>a |
| 368 | | - | <pre class="delphi"><code>private property</code></pre> |
| 369 | | - | <p>remains unused</p></li> |
| 252 | + | <li>a <code>private property</code> remains unused</li> |
| 370 | 253 | | </ul></td> |
| 371 | 254 | | </tr> |
| 372 | 255 | | <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> |
| 256 | + | <td><p><code>05074</code></p></td> |
| 257 | + | <td><p><code>unit_deprecated</code></p></td> |
| 375 | 258 | | <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> |
| 259 | + | <li>a unit with the <code>deprecated</code> hint (without a custom deprecation message supplied) is used</li> |
| 379 | 260 | | </ul></td> |
| 380 | 261 | | </tr> |
| 381 | 262 | | <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> |
| 263 | + | <td><p><code>05075</code></p></td> |
| 264 | + | <td><p><code>unit_deprecated</code></p></td> |
| 384 | 265 | | <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> |
| 266 | + | <li>a unit with the <code>deprecated</code> hint is used and a custom deprecation notice has been defined</li> |
| 388 | 267 | | </ul></td> |
| 389 | 268 | | </tr> |
| 390 | 269 | | <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> |
| 270 | + | <td><p><code>05076</code></p></td> |
| 271 | + | <td><p><code>unit_platform</code></p></td> |
| 393 | 272 | | <td><ul> |
| 394 | | - | <li>a unit with the |
| 395 | | - | <pre class="delphi"><code>platform</code></pre> |
| 396 | | - | <p>hint is used</p></li> |
| 273 | + | <li>a unit with the <code>platform</code> hint is used</li> |
| 397 | 274 | | </ul></td> |
| 398 | 275 | | </tr> |
| 399 | 276 | | <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> |
| 277 | + | <td><p><code>05077</code></p></td> |
| 278 | + | <td><p><code>unit_library</code></p></td> |
| 402 | 279 | | <td><ul> |
| 403 | 280 | | <li>[to be explained]</li> |
| 404 | 281 | | </ul></td> |
| 405 | 282 | | </tr> |
| 406 | 283 | | <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> |
| 284 | + | <td><p><code>05078</code></p></td> |
| 285 | + | <td><p><code>unit_unimplemented</code></p></td> |
| 409 | 286 | | <td><ul> |
| 410 | | - | <li>a unit with the |
| 411 | | - | <pre class="delphi"><code>unimplemented</code></pre> |
| 412 | | - | <p>hint is used</p></li> |
| 287 | + | <li>a unit with the <code>unimplemented</code> hint is used</li> |
| 413 | 288 | | </ul></td> |
| 414 | 289 | | </tr> |
| 415 | 290 | | <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> |
| 291 | + | <td><p><code>05079</code></p></td> |
| 292 | + | <td><p><code>unit_experimental</code></p></td> |
| 418 | 293 | | <td><ul> |
| 419 | | - | <li>a unit with the |
| 420 | | - | <pre class="delphi"><code>experimental</code></pre> |
| 421 | | - | <p>hint is used</p></li> |
| 294 | + | <li>a unit with the <code>experimental</code> hint is used</li> |
| 422 | 295 | | </ul></td> |
| 423 | 296 | | </tr> |
| 424 | 297 | | <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> |
| 298 | + | <td><p><code>06018</code></p></td> |
| 426 | 299 | | <td></td> |
| 427 | 300 | | <td><ul> |
| 428 | 301 | | <li>the compiler has determined there is, or might be, unreachable code</li> |
| 429 | 302 | | </ul></td> |
| 430 | 303 | | </tr> |
| 431 | 304 | | <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> |
| 305 | + | <td><p><code>07104</code></p></td> |
| 433 | 306 | | <td></td> |
| 434 | 307 | | <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> |
| 308 | + | <li>register indirect addressing with <code>ebp</code> is used in conjunction with a negative offset</li> |
| 438 | 309 | | </ul></td> |
| 439 | 310 | | </tr> |
| 440 | 311 | | </tbody> |
| 441 | 312 | | </table> |
| 442 | 313 | | |
| 443 | 314 | | Note, some aliases identify *multiple* messages. |
| 444 | 315 | | |
| 445 | 316 | | ## see also |
| 446 | 317 | | |
| 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 | | - | \]\] |
| 318 | + | - [§ “`$WARN`: Control emission of warnings” in the *Free Pascal programmer’s guide*](https://www.freepascal.org/docs-html/prog/progsu80.html) |
| 319 | + | - [[$message|{$message}]] |
| 460 | 320 | | - [[Turn warnings and hints on or off]] |
| 461 | 321 | | |
| 462 | 322 | | --- |
| 463 | 323 | | *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 | 324 | | Category: FPC |
| 465 | 325 | | Category: Local compiler directives |