[PATCH v2 07/17] stdio-common: Add scanf long double data for Intel/Motorola 80-bit format

Joseph Myers josmyers@redhat.com
Tue Mar 4 21:45:43 GMT 2025


On Sat, 1 Mar 2025, Maciej W. Rozycki wrote:

> +#undef compare_real
> +#define compare_real(x, y)						\
> +({									\
> +  union									\
> +    {									\
> +      type_t v;								\
> +      uint32_t i[3];							\
> +    }									\
> +  ux = { .v = x }, uy = { .v = y };					\
> +  static_assert (sizeof (ux.v) == sizeof (ux.i), "type_t size check");	\
> +  (ux.i[0] == uy.i[0] && ux.i[1] == uy.i[1]				\
> +   && (ux.i[2] & 0xffff) == (uy.i[2] & 0xffff));		 	\

I don't think this is correct for the big-endian (m68k) case, where the 
sign and exponent are at the start (big end) of the first word, not the 
little end of the last word.

-- 
Joseph S. Myers
josmyers@redhat.com



More information about the Libc-alpha mailing list