Specifies whether type-based aliasing is to be used during optimization. Type-based aliasing restricts the lvalues that can be used to access a data object safely.


Read syntax diagramSkip visual syntax diagram        .-ansialias---.
>>- -q--+-noansialias-+----------------------------------------><

See also #pragma options.


This option is obsolete. Use -qalias=ansi in your new applications.

The default with xlc, xlC, c99 and c89 is ansialias. The optimizer assumes that pointers can only point to an object of the same type.

The default with cc is noansialias.

This option has no effect unless you also specify the -O option.

If you select noansialias, the optimizer makes worst-case aliasing assumptions. It assumes that a pointer of a given type can point to an external object or any object whose address is already taken, regardless of type.

The following are not subject to type-based aliasing:


To specify worst-case aliasing assumptions when compiling myprogram.C, enter:

xlc++ myprogram.C -O -qnoansialias

Related information