Previous Up Next

6.8  Compiler Pragmas

Compiler pragmas are compiler directives which instruct the compiler to emit a particular code type. Their syntax is similar to directives:
:- pragma(Option).
It is not possible to have several pragmas grouped together and separated by commas like goals, every pragma must be specified separately. Option can be one of the following: By default, the compiler works as if the pragmas debug, expand and noskip were specified.

The pragma is active from its specification in the file until the file end or until it is disabled by another pragma. Recursive compilations or calls to other compiling predicates are not affected by the pragma. Pragmas which have the same effect as global flags override the global flags if they specify more optimized code. For instance, the pragma debug has no effect if the global flag debug_compile is off, but the pragma nodebug overrides the global flag debug_compile being on.

The pragmas are useful mainly for libraries and other programs that should be always compiled in a particular mode independently of the global flags setting.


Previous Up Next