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 - alias checking is relaxed. when this option is specified, the code http://www.X-Hacker.org [<<Previous Entry] [^^Up^^] [Next Entry>>] [Menu] [About The Guide]
Alias checking is relaxed.  When this option is specified, the code
optimizer will assume that global variables are not indirectly referenced
through pointers.  This assumption may reduce the size of the code that is
generated.  The following example helps to illustrate this point.
Example:

     extern int i;

     void rtn( int *pi )
     {
         int k;
         for( k = 0; k < 10; ++k ) {
             (*pi)++;
             i++;
         }
     }

In the above example, if "i" and "*pi" referenced the same integer object
then "i" would be incremented by 2 each time through the "for" loop and we
would call the pointer reference "*pi" an alias for the variable "i".  In
this situation, the compiler could not bind the variable "i" to a register
without making sure that the "in-memory" copy of "i" was kept up-to-date.
 In most cases, the above situation does not arise.  Rarely would we
reference the same variable directly by name and indirectly through a
pointer in the same routine.  The "oa" option instructs the code generator
that such cases do not arise in the module to be compiled.  The code
generator will be able to produce more efficient code when it does not have
to worry about the alias "problem".

The macro __SW_OA will be predefined if "oa" is selected.

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