Title
Type of std::fexcept_t
Status
new
Section
[cfenv.syn]
Submitter
Sam Elliott

Created on 2023-03-13.00:00:00 last changed 1 week ago

Messages

Date: 2023-03-18.14:54:55

Proposed resolution:

This wording is relative to N4928.

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

    […]
    namespace std {
      // types
      using fenv_t = object type;
      using fexcept_t = integerobject type;
      […]
    }
    
Date: 2023-03-19.08:38:41

<cfenv>, as specified in [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).

History
Date User Action Args
2023-03-18 14:54:55adminsetmessages: + msg13458
2023-03-13 00:00:00admincreate