Case 115: _BitInt(N) width change (C23 64 โ 128)¶
| Field | Value |
|---|---|
| Verdict | ๐ด BREAKING |
| Category | Breaking |
| Platforms | Linux |
| Flags | ABI break |
Detected ChangeKinds |
bit_int_width_changed |
| Source files | examples/case115_bit_int_width_changed/ |
Category: Binary ABI break / C23 | Verdict: ๐ด BREAKING
What changed¶
v1 uses C23 _BitInt(64) for an accumulator's storage, parameter, and
return type. v2 widens it to _BitInt(128). The bit width N is part of the
type: it determines the storage size of the Accumulator struct and the
calling-convention treatment of the by-value parameter and return.
A consumer built against v1 passes/reads a 64-bit value where the v2 library expects 128 bits, so arguments, the struct field, and the returned value are all miscompiled.
(128 bits is the maximum _BitInt width clang supports, so both versions stay
buildable on every supported toolchain.)
How abicheck catches it¶
bit_int_width_changed fires for each public slot (parameter, return, or
field) whose _BitInt(N) width changes โ or that migrates to/from _BitInt.
Files¶
v1.h/v2.hโ_BitInt(64)vs_BitInt(128)declarationsv1.c/v2.cโ the two library buildsapp.cโ consumer built against the 64-bit interface
Source files¶
CMakeLists.txtapp.cv1.cv1.hv2.cv2.h
See also: Examples overview ยท All BREAKING cases ยท Category: Breaking.