Wiki copymirror

This is a mirror of the wiki at pascal.chat. Editing, history and sign-in are there.

Hint Directives

English · Français · Suomi

Using Hint Directives

Whenever an identifier marked with a hint directive is later encountered by the compiler, then a warning will be displayed, corresponding to the specified hint.

The following are examples:

pascal
Const
  AConst = 12 deprecated;

var
  p : integer platform;

Function Something : Integer; experimental;

begin
  Something:=P+AConst;
end;

begin
  Something;
end.

This would result in the following output:

text
testhd.pp(11,15) Warning: Symbol "p" is not portable
testhd.pp(11,22) Warning: Symbol "AConst" is deprecated
testhd.pp(15,3) Warning: Symbol "Something" is experimental

Hint directives can follow all kinds of identifiers: units, constants, types, variables, functions, procedures and methods.


From the Free Pascal wiki, page "Hint Directives", as it stood on 2020-06-23 after a change by Kai Burghardt, out of the wiki's dump of 2024-05-26. Copyright stays with the author who wrote it, according to the old wiki's Licensing page. If you have concerns about this material, message the admin.

Revision 1, last changed by WikiArchive .