https://gcc.gnu.org/bugzilla/show_bug.cgi?id=119265
Bug ID: 119265
Summary: unsigned __int128 not converted properly by
-fdump-ada-spec, while __int128 is
Product: gcc
Version: 15.0
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: ada
Assignee: unassigned at gcc dot gnu.org
Reporter: tobias at strongswan dot org
CC: dkm at gcc dot gnu.org
Target Milestone: ---
Since 6.5, the Linux UAPI kernel header `linux/types.h` contains the following:
#ifdef __SIZEOF_INT128__
typedef __signed__ __int128 __s128 __attribute__((aligned(16)));
typedef unsigned __int128 __u128 __attribute__((aligned(16)));
#endif
Using `-fdump-ada-spec` to generate Ada specs from a header that includes this
results in:
subtype uu_s128 is Extensions.Signed_128; -- /usr/include/linux/types.h:12
subtype uu_u128 is uu_int128_unsigned; -- /usr/include/linux/types.h:13
So the second typedef with `unsigned __int128` is not mapped to
`Extensions.Unsigned_128` but a non-existent identifier, which results in an
error when compiling:
linux_types_h.ads:14:23: error: "uu_int128_unsigned" is undefined
Adding `#undef __SIZEOF_INT128__` before including `linux/types.h` (or a header
that includes it indirectly) may be used as a workaround.