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

Bug#344836: marked as done (libc6: strtold is broken on hppa)



Your message dated Sat, 11 Feb 2006 17:52:55 +0100
with message-id <20060211165254.GA28877@bode.aurel32.net>
and subject line libc6: strtold is broken on hppa
has caused the attached Bug report to be marked as done.

This means that you claim that the problem has been dealt with.
If this is not the case it is now your responsibility to reopen the
Bug report if necessary, and/or fix the problem forthwith.

(NB: If you are a system administrator and have no idea what I am
talking about this indicates a serious mail system misconfiguration
somewhere.  Please contact me immediately.)

Debian bug tracking system administrator
(administrator, Debian Bugs database)

--- Begin Message ---
Package: libc6
Version: 2.3.5-8
Severity: normal

The following program produces incorrect results:

#include <stdlib.h>
int
main ()
{
  printf ("%Lf\n", strtold ("1", NULL));
  return 0;
}

dave@gsyprf11:~/gcc_test$ gcc -o ld1 ld1.c
dave@gsyprf11:~/gcc_test$ ./ld1
0.000000


-- System Information:
Debian Release: testing/unstable
  APT prefers testing
  APT policy: (650, 'testing'), (90, 'unstable')
Architecture: hppa (parisc64)
Shell:  /bin/sh linked to /bin/bash
Kernel: Linux 2.6.13-pa1
Locale: LANG=C, LC_CTYPE=C (charmap=ANSI_X3.4-1968)

-- no debconf information


--- End Message ---
--- Begin Message ---
Hi!

On Mon, Dec 26, 2005 at 11:43:50AM -0800, John David Anglin wrote:
> Package: libc6
> Version: 2.3.5-8
> Severity: normal
> 
> The following program produces incorrect results:
> 
> #include <stdlib.h>
> int
> main ()
> {
>   printf ("%Lf\n", strtold ("1", NULL));
>   return 0;
> }
> 
> dave@gsyprf11:~/gcc_test$ gcc -o ld1 ld1.c
> dave@gsyprf11:~/gcc_test$ ./ld1
> 0.000000
> 

First of all this behaviour is not specific to hppa.

Secondly this is not bug. Try to build the example code with -Wall:
[bode:/tmp]$ gcc -Wall -o ld1 ./ld1.c
./ld1.c: In function 'main':
./ld1.c:5: warning: implicit declaration of function 'printf'
./ld1.c:5: warning: incompatible implicit declaration of built-in function 'printf'
./ld1.c:5: warning: implicit declaration of function 'strtold'
./ld1.c:5: warning: format '%Lf' expects type 'long double', but argument 2 has type 'int

The problem is that strtold is not declared, so gcc expects it returns
an int, but actually it returns a long double.

It is not declared because it is an ISO C99 function, whereas gcc uses
ISO C89 as the default standard.

To switch to an ISO C99 standard, either pass the -std=gnu99 flag to 
gcc, or define _ISOC99_SOURCE or _GNU_SOURCE, or define _XOPEN_SOURCE to
a value greater or egal to 600.

As this is not a bug, I am closing this bug report.

Bye,
Aurelien

-- 
  .''`.  Aurelien Jarno	            | GPG: 1024D/F1BCDB73
 : :' :  Debian developer           | Electrical Engineer
 `. `'   aurel32@debian.org         | aurelien@aurel32.net
   `-    people.debian.org/~aurel32 | www.aurel32.net

--- End Message ---

Reply to: