Sign in Join
Wiki copytemporary

local compiler directives

Deutsch · English · Français

Local compiler directives may be used more than once in a Pascal source code file.

Syntax

Data layout

Code generation

$R versus $Q

There is the completely artificial distinction between the meaning of "overflow" and "range check" errors as defined by Borland. They are basically exactly the same error, except that one is detected by checking the overflow flag of the CPU and the other by explicitly comparing ranges.

On 64 bit CPUs, integer arithmetic is performed using 64 bit integers because of Pascal's convention to evaluate expressions using the native signed integer type. As a result, overflows cannot occur there when performing 32 bit arithmetic and you will get a range error instead when assigning the result to a 32 bit variable. Ideally, there would be only a single switch that governs both range/overflow checking, but because of historical reasons (as explained above) there are two.

Platform-specific

For x86 processors only

Other

Data inclusion

Compile-time context

Conditional compilation

Conditional compilation can be achieved via the directives

Additionally, in {$mode MacPas} the directives

are allowed, too.

Compile-time behavior

With {$wait}, the compiler waits till the user hits ↵ Enter, and then resumes compilation.

Self-defined messages can be triggered with the directives:

Emission of messages can be controlled via the directives:

Ignored

Since FPC intends to be sort of compatible to some other compilers, some very common compiler directives stemming from the non-FPC-lands are recognized – not generating an illegal directive error – and ignored. Those are:

Historical

Following directives were recognized in earlier versions of FPC and are now illegal:

See also


From the Free Pascal wiki, page "local compiler directives", as it stood on 2021-09-04 after a change by Alextpp, 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 .

Talk about this page

Nobody has opened a bench for this page yet. Sign in to open one.