<p>Am 03.01.2014 11:06 schrieb "Pierre Free Pascal" <<a href="mailto:pierre@freepascal.org">pierre@freepascal.org</a>>:<br>
><br>
> > // prevents the compiler hint about not initialized variables<br>
> > procedure dcpFillChar(out x; count: SizeInt; Value: Byte);<br>
> > begin<br>
> >   {$HINTS OFF}<br>
> >   FillChar(x, count, value);<br>
> >   {$HINTS ON}<br>
> > end;<br>
> ><br>
> ><br>
> > begin<br>
> ><br>
> >    dcpFillchar(dirinfo,sizeof(dirinfo),$00);<br>
> >    FindFirst(pattern,AnyFile,dirinfo);<br>
> >    findclose(dirinfo);<br>
> > end.<br>
> > ----8<-------------8<-------------8<-------------8<-------------8<----<br>
> I would suggest to use the following sequence instead:<br>
> === code begin ===<br>
> {$push}<br>
> {$hints off}<br>
> // whatever<br>
> {$pop}<br>
> === code end ===<br>
><br>
>   The is a more specific way to remove a given hint:<br>
><br>
> Use -vq option to get the numeric value of the message:<br>
><br>
> E:\pas\test>ppc386 -vhq tsearchrec.pas<br>
> Hint: (11030) Start of reading config file<br>
> e:\pas\fpc-2.7.1\bin\i386-win32\fpc.cfg<br>
> Hint: (11031) End of reading config file<br>
> e:\pas\fpc-2.7.1\bin\i386-win32\fpc.cfg<br>
> tsearchrec.pas(13,20) Hint: (5058) Variable "dirinfo" does not seem to be<br>
> initialized<br>
><br>
> Disable that specific message by using -vm option:<br>
><br>
> E:\pas\test>ppc386 -vh -vm5058 tsearchrec.pas<br>
> Hint: Start of reading config file e:\pas\fpc-2.7.1\bin\i386-win32\fpc.cfg<br>
> Hint: End of reading config file e:\pas\fpc-2.7.1\bin\i386-win32\fpc.cfg<br>
><br>
> Magic, isn't it?</p>
<p>Maybe one should also mention that this can be done in code as well for specific locations:</p>
<p>=== code begin ===<br>
{$push}<br>
{$warn 5058 off}<br>
// whatever<br>
{$pop}<br>
=== code end ===</p>
<p>Regards,<br>
Sven</p>