This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
Re: [PATCH] Fix up long double fphex
- From: Jakub Jelinek <jakub at redhat dot com>
- To: Marek Polacek <polacek at redhat dot com>
- Cc: libc-alpha at sourceware dot org
- Date: Tue, 6 Mar 2012 22:26:45 +0100
- Subject: Re: [PATCH] Fix up long double fphex
- References: <20120304204257.GA4667@redhat.com>
- Reply-to: Jakub Jelinek <jakub at redhat dot com>
On Sun, Mar 04, 2012 at 09:42:57PM +0100, Marek Polacek wrote:
> --- libc/stdio-common/tst-long-dbl-fphex.c.mp 2012-03-04 19:09:18.595925212 +0100
> +++ libc/stdio-common/tst-long-dbl-fphex.c 2012-03-04 19:08:07.479774042 +0100
...
> +static int
> +do_test (void)
> +{
> + const long double x = 24.5;
> + 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);
I'm pretty sure this test fails on targets where long double isn't ldbl-96, but
ldbl-128, ldbl-128ibm or dbl-64, because for those
a will be L"0x1.88p+4" and A L"0X1.88P+4". Only ldbl-96 %La/%LA printing ever
prints before hexadecimal dot numbers from 2 to f/F.
Jakub