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 - this option prevents the compiler from omitting null pointer checks on http://www.X-Hacker.org [<<Previous Entry] [^^Up^^] [Next Entry>>] [Menu] [About The Guide]
This option prevents the compiler from omitting NULL pointer checks on
pointer conversions.  By default, the compiler omits NULL pointer checks on
pointer conversions when it is safe to do so.  Consider the following
example.

     struct B1 {
         int b1;
     };
     struct B2 {
         int b2;
     };
     struct D : B1, B2 {
         int d;
     };

     void clear_D( D *p )
     {
             p->d = 0;
             B1 *p1 = p;
             p1->b1 = 0;
             B2 *p2 = p;
             p2->b2 = 0;
     }

In this example, the C++ compiler must ensure that p1 and p2 become NULL if
p is NULL (since no offset adjustment is allowed for a NULL pointer).
 However, the first executable statement implies that p is not NULL since,
in most operating environments, the executing program would crash at the
first executable statement if p was NULL.  The "oz" option will prevent the
compiler from omitting the check for a NULL pointer.

The macro __SW_OZ will be predefined if "oz" is selected.

When "ox" is combined with the "on", "oe", "oa" and "ot" options ("oneatx")
and the "zp4" option, the code generator will attempt to give you the
fastest executing code possible irrespective of architecture.  Other options
can give you architecture specific optimizations to further improve the
speed of your code.  Note that specifying "oneatx" is equivalent to
specifying "oneatilmr" and "s".  See the section entitled Benchmarking Hints
for more information on generating fast code.

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