To: J3 J3/25-203 From: Patrick Fasano Subject: US05: Edits for C interchange and extended floating types Date: 2025-October-30 References: ISO/IEC 9899:2024 Programming languages -- C ("C23") (working draft N3220) WG5/N2249 Fortran 202Y Work Items ISO/IEC 60559:2020 Floating-Point arithmetic 25-189r1 Requirements and specifications for interoperability with C interchange and extended types 25-007r1 Fortran 2028 Working Draft 1 Background ============ The ISO C23 specification (ISO/IEC 9899:2024) added support for interchange and extended floating-point types (C23 Annex H). The current Fortran 202Y work list WG5/N2249 includes adding interoperability with these types as accepted work item US05. At meeting #237 in October 2025, J3 passed paper 25-189r1 as requirements and specifications for additional floating types. This paper provides edits for Fortran 202Y proposal US05, "Add C interoperability for new interchange floating point types in C". The ISO C23 specification also added 'bool' as a keyword with an alternate spelling of '_Bool'. This paper optionally provides edits for Fortran 202Y to propagate this change. 2 Edits (relative to 25-007r1) ============================== ------------------------------------------------------------------------ [xv] Add to "Intrinsic modules" the sentences: Named constants have been added to the ISO_C_BINDING module to allow interoperability with C interchange and extended floating-point formats defined in ISO/IEC 9899:2024 Annex H. ------------------------------------------------------------------------ [539:7-14] Replace 18.2.2 paragraph 4 with the following paragraphs: The values of C_FLOAT, C_DOUBLE, C_LONG_DOUBLE, C_FLOAT16, C_FLOAT32, C_FLOAT64, C_FLOAT128, C_FLOAT32X, C_FLOAT64X, C_FLOAT128X, C_DECIMAL32 C_DECIMAL64, and C_DECIMAL128 shall each be a valid value for a real kind type parameter on the processor or shall be -1 if the companion processor's type does not have a precision equal to the precision of any of the Fortran processor's real kinds, -2 if the companion processor's type does not have a range equal to the range of any of the Fortran processor's real kinds, -3 if the companion processor's type has neither the precision nor range of any of the Fortran processor's real kinds, -4 if there is no interoperating Fortran processor kind for other reasons, or -5 if the companion processor does not define the corresponding C type. The values of C_FLOAT_COMPLEX, C_DOUBLE_COMPLEX, C_LONG_DOUBLE_COMPLEX, C_FLOAT16_COMPLEX, C_FLOAT32_COMPLEX, C_FLOAT64_COMPLEX, C_FLOAT128_COMPLEX, C_FLOAT32X_COMPLEX, C_FLOAT64X_COMPLEX, and C_FLOAT128X_COMPLEX shall be the same as those of C_FLOAT, C_DOUBLE, C_LONG_DOUBLE, C_FLOAT16, C_FLOAT32, C_FLOAT64, C_FLOAT128, C_FLOAT32X, C_FLOAT64X, and C_FLOAT128X, respectively. If the companion processor defines the C preprocessor macros __STDC_IEC_60559_BFP__ and __STDC_IEC_60559_TYPES__, the values of C_FLOAT32 and C_FLOAT64 shall be the same as those of C_FLOAT and C_DOUBLE, respectively. ------------------------------------------------------------------------ [2:6] Insert a new line: ISO/IEC 9899:2024, Programming languages -- C ------------------------------------------------------------------------ [547:13] Replace the line The C types mentioned in Table 18.2 are defined in ISO/IEC 9899:2018, 6.2.5, 7.19, and 7.20.1. with the line The C types mentioned in Table 18.2 are defined in ISO/IEC 9899:2024, 6.2.5, 7.22, and H.2. ------------------------------------------------------------------------ [547:table 18.2] Add the following rows to the REAL section of the table: +--------------+-------------+ | C_FLOAT16 | _Float16 | | C_FLOAT32 | _Float32 | | C_FLOAT64 | _Float64 | | C_FLOAT128 | _Float128 | | C_FLOAT32X | _Float32x | | C_FLOAT64X | _Float64x | | C_FLOAT128X | _Float128x | | C_DECIMAL32 | _Decimal32 | | C_DECIMAL64 | _Decimal64 | | C_DECIMAL128 | _Decimal128 | +--------------+-------------+ ------------------------------------------------------------------------ [547-548:table 18.2] Add the following rows to the COMPLEX section of the table: +---------------------+---------------------+ | C_FLOAT16_COMPLEX | _Float16 _Complex | | C_FLOAT32_COMPLEX | _Float32 _Complex | | C_FLOAT64_COMPLEX | _Float64 _Complex | | C_FLOAT128_COMPLEX | _Float128 _Complex | | C_FLOAT32X_COMPLEX | _Float32x _Complex | | C_FLOAT64X_COMPLEX | _Float64x _Complex | | C_FLOAT128X_COMPLEX | _Float128x _Complex | +---------------------+---------------------+ ------------------------------------------------------------------------ [557:table 18.4] Add the following rows after the row for CFI_type_long_double: +---------------------+-------------+ | CFI_type_Float16 | _Float16 | | CFI_type_Float32 | _Float32 | | CFI_type_Float64 | _Float64 | | CFI_type_Float128 | _Float128 | | CFI_type_Float32x | _Float32x | | CFI_type_Float64x | _Float64x | | CFI_type_Float128x | _Float128x | | CFI_type_Decimal32 | _Decimal32 | | CFI_type_Decimal64 | _Decimal64 | | CFI_type_Decimal128 | _Decimal128 | +---------------------+-------------+ ------------------------------------------------------------------------ [557:table 18.4] Add the following rows after the row for CFI_type_long_double_Complex: +----------------------------+---------------------+ | CFI_type_Float16_Complex | _Float16 _Complex | | CFI_type_Float32_Complex | _Float32 _Complex | | CFI_type_Float64_Complex | _Float64 _Complex | | CFI_type_Float128_Complex | _Float128 _Complex | | CFI_type_Float32X_Complex | _Float32x _Complex | | CFI_type_Float64X_Complex | _Float64x _Complex | | CFI_type_Float128X_Complex | _Float128x _Complex | +----------------------------+---------------------+ ------------------------------------------------------------------------ [538:30] Replace two instances of: (_Bool) with: (bool) ------------------------------------------------------------------------ [548:table 18.2] Replace the following: _Bool with: bool ------------------------------------------------------------------------ [557:table 18.4] Replace the following: +---------------+-------+ | CFI_type_Bool | _Bool | +---------------+-------+ with: +---------------+------+ | CFI_type_Bool | bool | | CFI_type_bool | bool | +---------------+------+ ------------------------------------------------------------------------ ===END===