C/C++ Compiler (cl.hlp) (
Table of Contents;
Topic list)
Important Notice
The pages on this site contain documentation for very old MS-DOS software,
purely for historical purposes.
If you're looking for up-to-date documentation, particularly for programming,
you should not rely on the information found here, as it will be woefully
out of date.
Assume No Aliasing (/Oa, /Ow)
◄Up► ◄Contents► ◄Index► ◄Back►
─────C/C++ Compiler─────────────────────────────────────────────────────────
Syntax: /Oa
/Ow
The /Oa and /Ow options control the assumptions the compiler makes
regarding "aliasing" when it performs optimizations. These options
can significantly improve the performance of your program, but
there are a few situations in which these options are not
appropriate.
The /Oa option tells the compiler that your program does not
perform any aliasing (other than the very simple forms that the
compiler can detect) and that function calls are safe. This allows
the compiler to optimize your code more fully. However, if you
specify this option when compiling a program that does perform
aliasing, the compiler may produce incorrect code.
When you use the /Ow option, you specify that aliasing might occur
across function calls. Therefore, after each function call, pointer
variables must be reloaded from memory. For more information on the
/Oa and /Ow options and aliasing, see the "Programming Techniques"
manual.
Microsoft Windows can change the values of handles during the
execution of a function. Therefore, always use /Ow when you
program using Windows.
NOTE: You can instruct the compiler to disable optimizations
that are unsafe with code that does aliasing by using the
optimize pragma with either the a or w option.
-♦-