3.2.2 C99-compatible functions for controlling the ARM floating-point environment

The compiler supports all functions defined in the C99 standard, and functions that are not C99-standard.


The ARM® Compiler toolchain does not support floating-point exception trapping for AArch64 targets.


The following functionality requires a floating-point model that supports exceptions. In ARM Compiler 6 this is disabled by default, and can be enabled by the armclang command-line option -ffp-mode=full.

The C99-compatible functions are the only interface that enables you to install custom exception trap handlers with the ability to define your own return value. All the function prototypes, data types, and macros for this functionality are defined in fenv.h.

C99 defines two data types, fenv_t and fexcept_t. The C99 standard does not give information about these types, so for portable code you must treat them as opaque. The compiler defines them to be structure types.

The type fenv_t is defined to hold all the information about the current floating-point environment. This comprises:

  • The rounding mode.
  • The exception sticky flags.
  • Whether each exception is masked.
  • What handlers are installed, if any.

The type fexcept_t is defined to hold all the information relevant to a given set of exceptions.

Non-ConfidentialPDF file icon PDF versionARM 100073_0607_00_en
Copyright © 2014–2017 ARM Limited or its affiliates. All rights reserved.