[uClibc]strtod buggy?

Oliver Dawid od at fet.uni-hannover.de
Tue Jan 22 22:41:05 UTC 2002


hi there,

while compiling tcl8.3.4, the configure script complains about that the
strtod function is buggy.

Solaris2.4/Tru64 strtod bugs... buggy

at this point, the function is replaced by a fixstrtod function.

is this a bug in the configure script or is strtod really buggy? if so,
schouldn't it be fixed?

from config.log
---snip---
configure:3300: checking for strtod
configure:3350: checking for Solaris2.4/Tru64 strtod bugs
configure:3375: cc -pipe -o conftest    conftest.c  1>&5
configure: failed program was:
#line 3355 "configure"
#include "confdefs.h"

            extern double strtod();
            int main()
            {
                char *string = "NaN", *spaceString = " ";
                char *term;
                double value;
                value = strtod(string, &term);
                if ((term != string) && (term[-1] == 0)) {
                    exit(1);
                }
                value = strtod(spaceString, &term);
                if (term == (spaceString+1)) {
                    exit(1);
                }
                exit(0);
            }
---snip---

from fixstrtod.c
---snip---
#undef strtod

/*
 * Declare strtod explicitly rather than including stdlib.h, since in
 * somes systems (e.g. SunOS 4.1.4) stdlib.h doesn't declare strtod.
 */

extern double strtod();

double
fixstrtod(string, endPtr)
    char *string;
    char **endPtr;
{
    double d;
    d = strtod(string, endPtr);
    if ((endPtr != NULL) && (*endPtr != string) && ((*endPtr)[-1] == 0)) {
        *endPtr -= 1;
    }
    return d;
}
---snip---

od

-- 
   Oliver Dawid * od at fet.uni-hannover.de * http://www.fet.uni-hannover.de/~od/




More information about the uClibc mailing list