Turn warnings and hints on or off

From Free Pascal wiki
Jump to navigationJump to search

There are several ways to control the behavior of warnings in both the Lazarus IDE and in the source code itself. Some warnings and hints are not very useful in a particular case so you want to hide them from view. On the other hand, if you would hide warnings or hints globally, you may want to turn a particular warning or hint explicitly on for a particular piece of your code.

procedure TForm.Button1Click(sender:Tobject);
begin
  // DoSomethingThat does not use sender
  Form1.Button1.Caption := 'Test';  
end;

This will generate a hint that parameter sender is not used. Doh. I can see that!. Problem is that this hint turns up all over the place and I know what it means. How do I get rid if it?

Lazarus IDE options

Global option

Go to the Project Options->Compiler Options->Messages and uncheck 'Hint:Paramater "$1" not used'.
This will turn of this particular hint for your whole project.
If you would like to turn off this hint for all your projects, you can check the left bottom checkbox 'Set compiler options as default'.


lazarusglobal.png