[Lazarus] About a warning of unused parameter.

Carlos E. R. robin.listas at telefonica.net
Wed May 2 02:19:05 CEST 2018


Hi,

I'm experimenting with doing "ping host" on Lazarus using the Synapse
library (http://synapse.ararat.cz/doku.php/download). The code on my
side is very simple, I just have to "use pingsend", then basically
ping.ping('some host');

I have a little nuisance: building the included library produces a ton
of warnings. This thing was last updated on 2012 (release no. 40).

For instance, this one:

pingsend.pas(137,24) Hint: Parameter "Value" not used


The code is different on Windows or Linux, by using {$IFDEF MSWINDOWS}
clauses. On Linux, the effective code is;

function TPINGSend.Checksum6(Value: AnsiString): Word;
begin
  Result := 0;
end;

So the warning is true, but I don't see what I can do about it without
changing the function definition (I could just not call the function in
Linux). I can do:

  Result := 0;
  Value:='';

but that just changes the warning to:

pingsend.pas(137,24) Hint: Value parameter "Value" is assigned but never
used

which is of course true.



So I wonder if there is something to silence that particular warning
alone. Say, yes, I know about that one, shut up.


I see on the contextual menu of the warning that I can silence that
warning type on a file (all warnings of that type in that file, not just
the ones I know about):

{$WARN 5024 off : Parameter "$1" not used}

Lazarus writes "on"; tried both. Neither work, the warning still appears.

Ideas?

-- 
Cheers / Saludos,

		Carlos E. R.
		(from 42.3 x86_64 "Malachite" at Telcontar)

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 181 bytes
Desc: OpenPGP digital signature
URL: <http://lists.lazarus-ide.org/pipermail/lazarus/attachments/20180502/42281e2a/attachment.sig>


More information about the Lazarus mailing list