1.28 -fstrict-aliasing, -fno-strict-aliasing

Instructs the compiler to apply the strictest aliasing rules available.

Usage

-fstrict-aliasing is implicitly enabled at -O1 or higher. It is disabled at -O0, or when no optimization level is specified.

When optimizing at -O1 or higher, this option can be disabled with -fno-strict-aliasing.

Note:

Specifying -fstrict-aliasing on the command-line has no effect, since it is either implicitly enabled, or automatically disabled, depending on the optimization level that is used.

Examples

In the following example, -fstrict-aliasing is enabled:

armclang --target=aarch64-arm-none-eabi -O2 -c hello.c

In the following example, -fstrict-aliasing is disabled:

armclang --target=aarch64-arm-none-eabi -O2 -fno-strict-aliasing -c hello.c

In the following example, -fstrict-aliasing is disabled:

armclang --target=aarch64-arm-none-eabi -c hello.c
Non-ConfidentialPDF file icon PDF versionDUI0774J
Copyright © 2014–2017, 2019 Arm Limited or its affiliates. All rights reserved.