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

Maybe one should also mention that this can be done in code as well for
specific locations:

=== code begin ===
{$push}
{$warn 5058 off}
// whatever
{$pop}
=== code end ===

Regards,
Sven
_______________________________________________
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-pascal

Reply via email to