Created on 2022-11-10.00:00:00 last changed 12 months ago
Proposed resolution:
This wording is relative to N4917.
Modify [cinttypes.syn] as indicated:
-1- The contents and meaning of the header <cinttypes> are the same as the C standard library header <inttypes.h>, with the following changes:
(1.1) — The header <cinttypes> includes the header <cstdint> instead of <stdint.h>, and
(1.?) — intmax_t and uintmax_t are not required to be able to represent all values of extended integer types wider than long long and unsigned long long respectively, and
(1.2) — if and only if the type intmax_t designates an extended integer type, the following function signatures are added:
intmax_t abs(intmax_t); imaxdiv_t div(intmax_t, intmax_t);which shall have the same semantics as the function signatures intmax_t imaxabs(intmax_t) and imaxdiv_t imaxdiv(intmax_t, intmax_t), respectively.
See also: ISO C 7.8
[ 2023-02-13 Approved at February 2023 meeting in Issaquah. Status changed: Immediate → WP. ]
[ Issaquah 2023-02-06; LWG ]
Unanimous consent (13/0/0) to move to Immediate for C++23.
[ 2022-11; LEWG electronic polling ]
Unanimous consensus in favor.
[ Kona 2022-11-10; Waiting for LEWG electronic polling ]
This is the resolution for NB comment GB-080 17.4.1 [cstdint.syn] Sync intmax_t and uintmax_t with C2x.
With the approval of WG14 N2888 the next C standard will resolve the long-standing issue that implementations cannot support 128-bit integer types properly without ABI breaks. C++ should adopt the same fix now, rather than waiting until a future C++ standard is rebased on C2x.
[cinttypes.syn] also mentions those types, but doesn't need a change. The proposed change allows intmax_t to be an extended integer type of the same width as long long, in which case we'd still want those abs overloads.
Recommended change: Add to [cinttypes.syn] p2 "except that intmax_t is not required to be able to represent all values of extended integer types wider than long long, and uintmax_t is not required to be able to represent all values of extended integer types wider than unsigned long long."
History | |||
---|---|---|---|
Date | User | Action | Args |
2023-11-22 15:47:43 | admin | set | status: wp -> c++23 |
2023-02-13 11:31:32 | admin | set | messages: + msg13389 |
2023-02-13 11:31:32 | admin | set | status: immediate -> wp |
2023-02-07 01:44:06 | admin | set | messages: + msg13279 |
2023-02-07 01:44:06 | admin | set | messages: + msg13278 |
2023-02-07 01:44:06 | admin | set | status: lewg -> immediate |
2022-11-11 18:12:06 | admin | set | messages: + msg13021 |
2022-11-11 18:12:06 | admin | set | status: new -> lewg |
2022-11-11 00:40:18 | admin | set | messages: + msg13017 |
2022-11-10 00:00:00 | admin | create |