Bug 66 - wcstold functions are incorrect for 128bit long double
Summary: wcstold functions are incorrect for 128bit long double
Alias: None
Product: glibc
Classification: Unclassified
Component: libc (show other bugs)
Version: 2.3.3
: P2 normal
Target Milestone: ---
Assignee: GOTO Masanori
Depends on:
Reported: 2004-03-09 22:11 UTC by H.J. Lu
Modified: 2019-04-10 12:23 UTC (History)
0 users

See Also:
Last reconfirmed:
fweimer: security-

A patch to fix 128bit wcstold/wcstold_l (2.21 KB, patch)
2004-03-11 16:27 UTC, H.J. Lu
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description H.J. Lu 2004-03-09 22:11:37 UTC
[hjl@gnu libc]$ find -name wcstold.c
[hjl@gnu libc]$ find -name strtold.c

We are using 96 bit double for 128bit long double in wcstold functions.
wcstold should be treated similar as strtold.
Comment 1 H.J. Lu 2004-03-11 16:27:18 UTC
Created attachment 30 [details]
A patch to fix 128bit wcstold/wcstold_l

There is only one wcstold.c under wcsmbs, which is used on all
platforms. It has

# define SET_MANTISSA(flt, mant) \
  do { union ieee854_long_double u;					      \

       u.d = (flt);							      \

       if ((mant & 0x7fffffffffffffffULL) == 0) 			      \

	 mant = 0x4000000000000000ULL;					      \

       u.ieee.mantissa0 = (((mant) >> 32) & 0x7fffffff) | 0x80000000;	      \

       u.ieee.mantissa1 = (mant) & 0xffffffff;				      \

       (flt) = u.d;							      \

  } while (0)

But it is for 96bit IEEE long double and won't work for 128bit IEEE
long double. This patch just includes <strtold.c> or <strtold_l.c>,
which support different long doubles.
Comment 2 Ulrich Drepper 2004-03-15 03:50:21 UTC
Should be handled correctly in CVS.  Not with the attached patch, though, but
with a completely different solution.