Subject: lib/35511: vfprintf cannot handle long double
To: None <lib-bug-people@netbsd.org, gnats-admin@netbsd.org,>
From: None <rillig@NetBSD.org>
List: netbsd-bugs
Date: 01/29/2007 04:35:00
>Number:         35511
>Category:       lib
>Synopsis:       vfprintf cannot handle long double
>Confidential:   no
>Severity:       critical
>Priority:       medium
>Responsible:    lib-bug-people
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Mon Jan 29 04:35:00 +0000 2007
>Originator:     Roland Illig
>Release:        
>Organization:
>Environment:
>Description:
Since ISO C99, it is required that the printf family of functions be able to format long double numbers.

>How-To-Repeat:
#include <x86/float.h>

int main(void) {
  printf("%Lg\n", LDBL_MAX);
  return 0;
}

/* This program should _not_ print "inf". */

>Fix:
Import some functions that can handle the long double case of the thing that __dtoa (or dtoa) is currently doing. The rest should be fairly easy.