Intel® C++ Compiler Classic Developer Guide and Reference

ID 767249
Date 3/31/2023
Public

A newer version of this document is available. Customers should click here to go to the newest version.

Document Table of Contents

ansi-alias, Qansi-alias

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

Syntax

Linux:

-ansi-alias

-no-ansi-alias

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