[PATCH v2 1/1] inet: add support for 64-bit network byte order
Joseph Myers
josmyers@redhat.com
Tue Mar 11 20:51:02 GMT 2025
On Tue, 11 Mar 2025, Florian Weimer wrote:
> > Alternatively, C23 Annex H defines encodefN / decodefN functions that can
> > be used with _Float32 / _Float64 (and that follow __STDC_ENDIAN_NATIVE__,
> > so you'd then need to do endian conversion; endian-aware loads / stores
> > didn't get into the C standard before C2Y, but you could of course combine
> > encodefN / decodefN with interfaces such as htobe64; encodefN / decodefN
> > use unsigned char arrays, so you can cast a pointer to an integer and the
> > aliasing is OK). Since _Float32 and _Float64 are defined to follow the
> > semantics of IEEE interchange formats, they are semantically preferable to
> > float and double for this - just as uint64_t is preferable to unsigned
> > long long for such purposes (both in the types used in the interfaces, and
> > in the naming where "64" is preferable to "ll").
>
> Do any of these interfaces cover the mixed endian doubles that some
> 32-bit Arm ABIs use? Or are all of these obsolete/not supported by
> glibc?
glibc doesn't support any configurations with mixed-endian doubles. I
removed OABI support from Arm glibc in 2012, and support for FPA floating
point was also removed from GCC in 2012.
--
Joseph S. Myers
josmyers@redhat.com
More information about the Libc-alpha
mailing list