# About Compiler Checks

CodeSnip can be configured to test compile snippets with any supported compiler that is installed on the local computer. Note that freeform snippets cannot be test compiled.

The supported compilers are the Win32 Delphi compilers from Delphi 2 to Delphi 12 Athens and Free Pascal.

## Configuring CodeSnip

Before CodeSnip can use the compilers it needs to be told about them. Compilers are registered for use by CodeSnip This is done using the Configure Compilers dialogue box that is accessed from the Tools menu.

You can customise the command line switches passed to the compilers to replicate your usual compilation defaults. Compiler search paths can also be configured. Both these actions are also done in the Configure Compilers dialogue box.

When using the standard version of CodeSnip, compiler configuration is stored on a per user basis, i.e. each user account maintains separate compiler configuration information. Therefore each user must configure compilers separately. The reason for this is that each user may wish to use a different set of available compilers and / or may wish to use different compiler switches and search paths.

The portable version of CodeSnip only maintains one set of compiler configuration information per installation.

### Automatic detection of Delphi compilers

By default, when CodeSnip starts up, it will check if there are any versions of Delphi installed on the user's system that CodeSnip could use, but that are not registered for use. Any such compilers are displayed in the Unregistered Delphi Installation(s) Detected dialogue box where you can choose whether or not to register them.

It is possible to switch off automatic detection on either a global or a per compiler basis. For more information see the Register Compilers with CodeSnip topic.

## Running the tests

Select the required routine in the Overview Pane. Select the Compile | Test Compile Snippet menu option, press F9 or click the Test Compile toolbar button. This will generate a test unit for the snippet and try to compile it with all the configured compilers. The results are displayed in the Test Compile Results dialogue box.

You can see details of any compiler errors or warnings relating to the last test compile by choosing the Compile | View Compile Errors menu option. This information can also be displayed from the Test Compile Results dialogue box.

The test unit can be displayed in a dialogue box by choosing the Compile | View Test Unit menu option.

## Compiler Warnings

If any of the Delphi compilers from Delphi 6 onwards show one or more warnings following a test compile, you may be able to inhibit them by configuring CodeSnip's code generator to emit suitable compiler directives. This is done using the Code Generation page of the Preferences dialogue box. Display the dialogue box using the Tools | Preferences menu option.