Sign in Join

Live chat for Free Pascal, Lazarus, Delphi and every Pascal programmer.

Mailing lists / lazarus / 2015-02

Confusing compiler hint on unused parameter

7 messages · 3 people ·

Reply by email Subscribe to this list Your subscription

Read-only archive. Use j and k to move between messages.

Werner Pamler

This compiler message looks strange to me: "tatextelements.pas(177,24) Hint: Value parameter "AValue" is assigned but never used". It occurs when TAChart is recompiled (see bug report #0027484). Here is the corresponding code:

procedure TGenericChartMarks.SetFrame(AValue: _TFramePen);
begin
   if FFrame = AValue then exit;
   FFrame.Assign(AValue);
   StyleChanged(Self);
end;

I would say that the parameter "AValue" *is* used. So, what is this hint for?

Reply by email

Sven Barth
to Werner Pamler
"Werner Pamler" wrote
This compiler message looks strange to me: "tatextelements.pas(177,24)

Hint: Value parameter "AValue" is assigned but never used". It occurs when TAChart is recompiled (see bug report #0027484). Here is the corresponding code:

Show quoted text 9 lines
procedure TGenericChartMarks.SetFrame(AValue: _TFramePen); begin if FFrame = AValue then exit; FFrame.Assign(AValue); StyleChanged(Self); end; I would say that the parameter "AValue" *is* used. So, what is this hint

for?

What compiler version? If 2.6.x please retest with a 3.x version. If it is still reproducible then try to reproduce it in a smaller, self contained example and report as a bug for FPC.

Regards,
Sven
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.lazarus.freepascal.org/pipermail/lazarus/attachments/20150217/3d01b313/attachment-0001.html>

Reply by email

Mattias Gaertner
to Werner Pamler: This compiler message looks strange to me: "tatextelements.pas(177,24) Hint: Value…
Show quoted text 14 lines
This compiler message looks strange to me: "tatextelements.pas(177,24) Hint: Value parameter "AValue" is assigned but never used". It occurs when TAChart is recompiled (see bug report #0027484). Here is the corresponding code: procedure TGenericChartMarks.SetFrame(AValue: _TFramePen); begin if FFrame = AValue then exit; FFrame.Assign(AValue); StyleChanged(Self); end; I would say that the parameter "AValue" *is* used. So, what is this hint for?

This is a generic class. The compiler does not know at this point what _TFramePen is. The hint sounds like a compiler bug. Please report to FPC.

Mattias

Reply by email

Mattias Gaertner
to Sven Barth: Hint: Value parameter "AValue" is assigned but never used". It occurs when TAChart is…
Show quoted text 18 lines
Am 17.02.2015 16:58 schrieb "Werner Pamler" : > > This compiler message looks strange to me: "tatextelements.pas(177,24) Hint: Value parameter "AValue" is assigned but never used". It occurs when TAChart is recompiled (see bug report #0027484). Here is the corresponding code: > > procedure TGenericChartMarks.SetFrame(AValue: _TFramePen); > begin > if FFrame = AValue then exit; > FFrame.Assign(AValue); > StyleChanged(Self); > end; > > I would say that the parameter "AValue" *is* used. So, what is this hint for? What compiler version?

1.4RC1 is built with 2.6.4.

If 2.6.x please retest with a 3.x version. If it is still reproducible then try to reproduce it in a smaller, self contained example and report as a bug for FPC.

Mattias

Reply by email

Werner Pamler

The bug report mention in the first post refers to another set of compilation messages which I do not understand:
"tachartlazaruspkg.pas(18,23) Verbose: Unit "TAFitUtils" not used in TAChartLazarusPkg". I cannot reproduce this, neither in fpc 2.6.4 nor fpc trunk. Is this due to some non-standard compilation message parameters used by the OP?

Reply by email

Mattias Gaertner
to Werner Pamler
Show quoted text 6 lines
The bug report mention in the first post refers to another set of compilation messages which I do not understand: "tachartlazaruspkg.pas(18,23) Verbose: Unit "TAFitUtils" not used in TAChartLazarusPkg". I cannot reproduce this, neither in fpc 2.6.4 nor fpc trunk. Is this due to some non-standard compilation message parameters used by the OP?

The original message comes from FPC and is a hint. Each package has an option (Compiler Options / Verbosity / Show hints for unused units in main), which is off by default. The IDE changes the "Hint" into a mere "Verbose".
By default the Messages windows does not show "Verbose" messages.

You can change the filter:
Right click on "Messages" window, then "Filter non urgent messages".

The bug submitter has turned the filter off. This filter is a new feature of 1.4. With the default settings you see the same as in Lazarus 1.2.

Mattias

Reply by email