suppressing hints[Re: [fpc-pascal] How to solve "variable does not seem to be initialized" compiler hint.]
Martin
lazarus at mfriebe.de
Thu Nov 19 23:48:40 CET 2009
Rainer Stratmann wrote:
> Am Thursday 19 November 2009 23:16:26 schrieb Vinzent Höfler:
>
>> Martin <fpc at mfriebe.de>:
>>
>>> Ideally it would be, if there was a directive or similar, to suppress it
>>> for given lines (or statements).
>>> one that is easier than {$push} { $HINT OFF} ... {$POP}
>>>
>> {$HINTS OFF}
>>
>> ... code ...
>>
>> {$HINTS DEFAULT}
>>
>> maybe? Whereas DEFAULT restores the switch to the original state.
>>
>>
>> Vinzent.
>>
>
> But then you have to do it everywhere in the code instead of one time.
>
That's the idea of hints. Telling you you need to look at the code once,
and if it's ok => good. But if the hint was correct => fix it.
This was in reply to
> use -vm1234 in the future to globally suppress this warning/note/hint
which would suppress *all* hints of the "uninitialized" type. => Which
means you may lose possible valuable hints.
It defeats the idea of hints to turn them off globally (even if only
specific hints).
You need to turn them off locally only.
This does not solve (but did not reply to neither) the case where if a
hint for FillChar is generated, this hint is always wrong. (hence I
changed the subject)
Martin
More information about the fpc-pascal
mailing list