Enables or disables the use of ANSI aliasing rules in optimizations.

Syntax

Linux and macOS:

-ansi-alias

-no-ansi-alias

Windows:

/Qansi-alias

/Qansi-alias-

Arguments

None

Default

Windows* systems: /Qansi-alias-

ANSI aliasing rules are disabled in optimizations.

Linux* and macOS* systems: -ansi-alias

ANSI aliasing rules are enabled in optimizations.

Description

This option tells the compiler to assume that the program adheres to ISO C Standard aliasability rules.

If your program adheres to the ANSI aliasability rules, this option allows the compiler to optimize more aggressively. If your program does not adhere to these rules, this option may cause the compiler to generate incorrect code.

If you are compiling on a Linux* or an macOS* system and your program does not adhere to the ANSI aliasability rules, you can specify -no-ansi-alias to ensure program correctness.

When you specify the [Q]ansi-alias option, the ansi-alias checker is enabled by default. To disable the ansi-alias checker, you must specify -no-ansi-alias-check (Linux* and macOS*) or /Qansi-alias-check- (Windows*).

IDE Equivalent

Visual Studio: Language > Enable Use of ANSI Aliasing Rules in Optimizations

Eclipse: Language > Enable Use of ANSI Aliasing Rules in Optimizations

Xcode: Language > Enable ANSI Aliasing

Alternate Options

Linux and macOS*: -fstrict-aliasing

Windows: None

See Also

Para obter informações mais completas sobre otimizações do compilador, consulte nosso aviso de otimização.