[PATCH] Fix up long double fphex

Ulrich Drepper drepper@gmail.com
Tue Mar 6 23:00:00 GMT 2012


On Sun, Mar 4, 2012 at 15:42, Marek Polacek <polacek@redhat.com> wrote:
> +  wchar_t a[16 * sizeof (wchar_t)];
> +  swprintf (a, 16 * sizeof (wchar_t), L"%La\n", x);
> +  wchar_t A[16 * sizeof (wchar_t)];
> +  swprintf (A, 16 * sizeof (wchar_t), L"%LA\n", x);
> +
> +  return (wmemcmp (a, L"0xc.4p+1", 8) != 0
> +         || wmemcmp (A, L"0XC.4P+1", 8) != 0);

These tests are not correct.  The x86/x86-64 instruction uses four
bits for the first digit but that's not guaranteed.  There can be four
different results and they all should be allowed.



More information about the Libc-alpha mailing list