[fpc-devel] Incorrect hint (5023) "unit not used", if unit is only used in a conditional compiler expression (like: {$IF ..})

J. Gareth Moreton gareth at moreton-family.com
Fri Jan 13 13:17:35 CET 2023


In my opinion, yes, report this as a bug.  Sure, it's what I'd consider 
"low priority" since it's just an incorrect informative hint rather than 
something critical, but it's a bug nonetheless.

Kit

On 13/01/2023 11:54, Bart via fpc-devel wrote:
> Consider the follwoing program:
> ===
> program test;
>
> uses
>    Version;
>
> begin
>    {$if TheVersion >= 1}
>    writeln('Version 1 or higher');
>    {$else}
>    writeln('Version < 1');
>    {$endif}
> end.
> ===
> unit version;
>
> interface
> const
>    TheVersion = 1;
>
> implementation
>
> end.
> ===
> Compile with -vh
> You get the hint:  Unit "version" not used in test
>
> This is obviously not true, without the unit version, the program won't compile.
>
> Should I report this as a bug?
>


More information about the fpc-devel mailing list