Retro video games delivered to your door every month!
Click above to get retro games delivered to your door ever month!
X-Hacker.org- Watcom C/C++ User's Guide - auxiliary pragmas are used to describe attributes that affect code http://www.X-Hacker.org [<<Previous Entry] [^^Up^^] [Next Entry>>] [Menu] [About The Guide]
Auxiliary pragmas are used to describe attributes that affect code
generation.  Initially, the compiler defines a default set of attributes.
 Each auxiliary pragma refers to one of the following.

 1. a symbol (such as a variable or function)

 2. a type definition that resolves to a function type

 3. the default set of attributes defined by the compiler

When an auxiliary pragma refers to a particular symbol, a copy of the
current set of default attributes is made and merged with the attributes
specified in the auxiliary pragma.  The resulting attributes are assigned to
the specified symbol and can only be changed by another auxiliary pragma
that refers to the same symbol.

An example of a type definition that resolves to a function type is the
following.


     typedef void (*func_type)();

When an auxiliary pragma refers to a such a type definition, a copy of the
current set of default attributes is made and merged with the attributes
specified in the auxiliary pragma.  The resulting attributes are assigned to
each function whose type matches the specified type definition.

When "default" is specified instead of a symbol name, the attributes
specified by the auxiliary pragma change the default set of attributes.  The
resulting attributes are used by all symbols that have not been specifically
referenced by a previous auxiliary pragma.

Note that all auxiliary pragmas are processed before code generation begins.
 Consider the following example.


     code in which symbol x is referenced
     #pragma aux y <attrs_1>;
     code in which symbol y is referenced
     code in which symbol z is referenced
     #pragma aux default <attrs_2>;
     #pragma aux x <attrs_3>;

Auxiliary attributes are assigned to x, y and z in the following way.

 1. Symbol x is assigned the initial default attributes merged with the
    attributes specified by <attrs_2> and <attrs_3>.

 2. Symbol y is assigned the initial default attributes merged with the
    attributes specified by <attrs_1>.

 3. Symbol z is assigned the initial default attributes merged with the
    attributes specified by <attrs_2>.

Online resources provided by: http://www.X-Hacker.org --- NG 2 HTML conversion by Dave Pearson