[Lazarus] Hints usability (was: Re: Large program size - 1.8 MB for empty GUI project)

Luiz Americo Pereira Camara luizmed at oi.com.br
Sat Apr 11 13:39:20 CEST 2009

Alexander Klenin escreveu:
> 2009/4/9 Mattias Gärtner <nc-gaertnma at netcologne.de>:
>>> As I already written some time ago, the solution is to introduce a
>>> hint/warning for the circular dependencies in implementation sections.
>>> This hint should probably be disabled by default, for compatibility reasons.
>> Yes, a hint would be nice.
>> But a hint won't be enough. It would go unnoticed too easy.
> This is another important problem. Easily unnoticed hints are just useless.
> There are two related causes here:
> 1) The message window interface of Lazarus is currently very weak.
>   (And it hides most of the hints by default, which I consider a bug in design).
>   This interface is one thing I think is worth borrowing from Visual Studio.
> 2) The compiler produces _many_ extraneous hints, which is very harmful --
>   it is impossible to produce hints-free code, so new hints has much
> more chances
>   to go unnoticed.
> First point is IMO of "patches welcome" category (and perhaps I will
> provide some,
> but don't count on that), but the second one is more fundamental.
> There are two main sources of harmful hints now:
> 1) "Parameter unused".
> This is by far the main culprit. There are many cases when parameters are
> unused deliberately -- e.g. basic implementations of virtual
> functions, most events etc.
> OTOH, the hint is not _entirely_ useless and can in some rare cases
> point to a real bugs.
> The solution is to enable per-variable hint suppression. It is done in C/C++
> by omitting variable name, but I think a better way would be a
> compiler directive.
> I see two variants:
>  a) procedure TMyForm.Button1Click(ASender {$UNUSED}: TObject);
>  b) procedure TMyForm.Button1Click(ASender: TObject); {$UNUSED ASender}

Are you aware that fpc trunk already implemented an option to disable hints?

See: http://bugs.freepascal.org/view.php?id=8690


More information about the Lazarus mailing list