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

Bug#415417: libc6: INF not accepted by strtod in Turkish locales (tr_TR.iso88599)



Package: libc6
Version: 2.3.6.ds1-13
Severity: normal

The ISO C standard requires "INF" to be accepted by strtod:

         -- one of INF or INFINITY, ignoring case

But in Turkish locales (LC_ALL=tr_TR.iso88599), where the lowercase
'I' is the dotless 'i', "INF" (or similar) is not recognized as the
infinity. This can be seen with the following program and
LC_ALL="tr_TR.iso88599".

#include <stdio.h>
#include <stdlib.h>
#include <locale.h>

int main (void)
{
  double x;
  char *end;
  int err;

  if (setlocale (LC_ALL, "") == NULL)
    {
      fprintf (stderr, "Can't set locales\n");
      exit (EXIT_FAILURE);
    }

  x = strtod ("INF", &end);
  err = *end != '\0';
  printf ("x = %f - error: %s\n", x, err ? "yes" : "no");

  return err;
}

Note: I reported this bug on 2005-08-22 here:

  http://sources.redhat.com/bugzilla/show_bug.cgi?id=1230

when I had the libc6 2.3.5-4 Debian package. It was fixed on 2005-09-28
in the CVS trunk. But it is still present in Debian.

-- System Information:
Debian Release: 4.0
  APT prefers unstable
  APT policy: (500, 'unstable'), (500, 'testing'), (500, 'stable')
Architecture: i386 (i686)
Shell:  /bin/sh linked to /bin/bash
Kernel: Linux 2.6.18-4-686-bigmem
Locale: LANG=POSIX, LC_CTYPE=en_US.ISO8859-1 (charmap=ISO-8859-1)

Versions of packages libc6 depends on:
ii  tzdata                        2007c-1    Time Zone and Daylight Saving Time

libc6 recommends no packages.

-- no debconf information



Reply to: