This is the mail archive of the libc-alpha@sourceware.org mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH] Fix up long double fphex


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]