bug-bash
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

AW: bash 2.05a on HP-UX 11.00 requires patch


From: Austermuehle Stephan
Subject: AW: bash 2.05a on HP-UX 11.00 requires patch
Date: Thu, 22 Nov 2001 14:47:58 +0100

Andreas,

well, at the moment (HP-UX 11.X) strtold(3C) definitively returns the type
long_double. In the release notes HP states that they will change the return
type to long double one day. Meanwhile HP-UX users need a work-around to get
the bash running. I hope that HP makes this function conforming to the
standard soon, but I think we won't see this in HP-UX 11.00, or 11i.

Extract from the Release Notes:

 strtold(3C) is being deprecated and may be replaced in a future release
 by an API of the same name but with a different return type (the
 deprecated strtold returns long_double (which is an array of four
 unsigned 32-bit ints); the future strtold, if implemented, will
 return an ANSI C long double (which is a 128-bit floating point
 scalar).

 New applications should avoid using strtold whenever possible. If
 ANSI C applications must use strtold, they should convert the
 returned long_double to a long double as described below (see the
 "Alternatives" section below).

Alternatives
-----------------------------------------------------------------------
 Applications that need to convert a long_double returned by strtold
 into an ANSI C long double should either use memcpy or use the C
 union type. Here is a code excerpt showing how to do the conversion
 with a union:

  union {
                          long_double l_d;
                          long double ld;
             } u;

 /* convert str to a long_double; store return val in union */
 /* (Putting value into union enables converted value to be */
 /* accessed as an ANSI C long double)*/

  u.l_d = strtold( (const char *)str, (char **)NULL);

 WARNING: Applications must not cast a long_double * to a long double *.
 They are aligned on different boundaries, and the cast may cause a
 processor fault (bus error).

Regards,

Stephan


-----Ursprüngliche Nachricht-----
Von: Andreas Schwab [mailto:schwab@suse.de]
Gesendet: Donnerstag, 22. November 2001 14:42
An: Stephan.Austermuehle@mgi.de
Cc: bug-bash@gnu.org
Betreff: Re: bash 2.05a on HP-UX 11.00 requires patch


Stephan.Austermuehle@mgi.de (Austermuehle  Stephan) writes:

|> Fix:
|>      According to Mrs. Katharina Christen from HP Support Germany the
|> function strtold() does not return the type long double but long_double
and
|> she stated that the man page for strtold(3C) on HP-UX 11.00 is incorrect.
|> The HP-UX 11.X release notes suggest the work-around that is contained in
|> the attached patch. strtold() shouldn't be used in new applications.

strtold is a standard part of ISO C, where it states that it returns long
double.  Anything you're being told by HP is rubbish.  They should fix
their compiler/libc.

Andreas.

-- 
Andreas Schwab                                  "And now for something
Andreas.Schwab@suse.de                          completely different."
SuSE Labs, SuSE GmbH, Schanzäckerstr. 10, D-90443 Nürnberg
Key fingerprint = 58CA 54C7 6D53 942B 1756  01D3 44D5 214B 8276 4ED5



reply via email to

[Prev in Thread] Current Thread [Next in Thread]