
             (Useful) Compiler #PRAGMA Directives in KRoC/Linux
             --------------------------------------------------


This is essentially a quick run-down of the available #PRAGMA directives
in the occam compiler (occ21).  The directives which affect the parallel
usage and alias checkers should only be used when really necessary.

Here is the list (there are others, but they are largely irrelevant):

    #PRAGMA SHARED name-list

        This allows variable/parameter names in `name-list' to be
        assigned to in parallel.  This is commonly used with the
        user-defined SEMAPHORE type to share data in relative safety.
        This #PRAGMA must appear immediately after the declaration.
        The `name-list' is separated with commas.

    #PRAGMA PERMITALIASES name-list

        This allows variable/parameter names in `name-list' to be
        aliased freely.  This is not commonly used.  This #PRAGMA
        must appear immediately after the declaration.  The
        `name-list' is separated with commas.

    #PRAGMA EXTERNAL "PROC name (params) = usage"

        This declares an external name to the compiler.  A standard
        PROC header is used, but one which is augmented with `usage'
        information.  This takes the form of at least one and at
        most three values, separated by commas.  The first gives
        the workspace requirements, followed by vectorspace
        requirements and finally by mobilespace requirements.

        Special handling is needed when interfacing with any language
        other than occam, since calling conventions differ.  C is
        interfaced by specifying the `name' as "C.foo" (where foo
        is the appropriate function name).  See the file native-call.ps
        for information on linking with C code.  As well as prefixing
        `name' with "C." for a straight C call, "B." and "BX." are
        also valid.  These indicate "blocking" external functions,
        which will be run in their own OS-level thread.  See the
        file blocking-native.ps for more information on this, and
        bsclib.ps for socket/file/process libraries which use it.

    #PRAGMA TRANSLATE identifier "string"

        This is used to link with code which does not use valid
        occam identifier names.  Some special handling is performed
        by default for C linkage.  This #PRAGMA is not commonly used.
        Where `identifier' is called in the source, calls to `string'
        will be made in the (transputer) object file.

    #PRAGMA COMMENT "string"

        This is used to insert comments into the (transputer) object
        file.  It is equivalent to:

            #COMMENT "string"

        The most common use of this is to insert copyright and other
        information into the compiler output.

    #PRAGMA DEFINED name-list

        This is used to force the undefined-checker into thinking the
        names in `name-list' are defined at the point the #PRAGMA
        appears.  This is useful when the undefined-checker cannot
        analyse the program logic correctly and generates warnings.

    #PRAGMA UNDEFINED name-list

        Similar to #PRAGMA DEFINED, but causes the names in `name-list'
        to be undefined at the point the #PRAGMA appears.

    #PRAGMA IOSPACE name-list

        This is used in conjunction with PLACED arrays to indicate
	that accesses to `name-list' should be done using I/O
	instructions rather than read/write instructions.  This is
	architecture-specific and currently only works for the i386
	KRoC target.

