This page is a snapshot from the LWG issues list, see the Library Active Issues List for more information and the meaning of WP status.

3905. Type of std::fexcept_t

Section: 28.3.1 [cfenv.syn] Status: WP Submitter: Sam Elliott Opened: 2023-03-13 Last modified: 2023-11-22

Priority: Not Prioritized

View all issues with WP status.

Discussion:

<cfenv>, as specified in 28.3.1 [cfenv.syn], requires fexcept_t to be an integer type:

using fexcept_t = integer type;

<cfenv> was initially added to the (first) Technical Report on C++ Library Extensions via N1568 and then integrated into the C++ Working Draft N2009 in Berlin (April, 2006).

However, C99 does not actually require that fexcept_t is an integer type, it only requires:

The type fexcept_t represents the floating-point status flags collectively, including any status the implementation associates with the flags.

Relaxing this requirement should not cause conforming C++ implementations to no longer be conforming. In fact, this should enable conforming C implementations to become conforming C++ implementations without an ABI break. The only incompatibility I foresee is where a user's program is initializing a std::fexcept_t with an integer value, which would become invalid on some C++ implementations (but not those that were previously conforming).

[2023-05-24; Reflector poll]

Set status to Tentatively Ready after six votes in favour during reflector poll.

[2023-06-17 Approved at June 2023 meeting in Varna. Status changed: Voting → WP.]

Proposed resolution:

This wording is relative to N4928.

  1. Modify 28.3.1 [cfenv.syn], header <cfenv> synopsis, as indicated:

    […]
    namespace std {
      // types
      using fenv_t = object type;
      using fexcept_t = integerobject type;
      […]
    }