Subject: strtod? (hanging lint1)
To: None <current-users@netbsd.org>
From: Sean Doran <smd@ebone.net>
List: current-users
Date: 11/17/1998 17:57:20
The problem is in strtod, as seen in the gdb below.

This C fragment illustrates the problem.

	Sean.

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

main()
{
double d;
char s[] = "18446744073709551615.0";

        printf("%d\n", strtod(s, NULL));
}

sean# !cc
cc -o main main.c
sean# ./main

[where it hangs]

sean# gdb /usr/libexec/lint1
GDB is free software and you are welcome to distribute copies of it
 under certain conditions; type "show copying" to see the conditions.
There is absolutely no warranty for GDB; type "show warranty" for details.
GDB 4.16 (i386--netbsd), Copyright 1996 Free Software Foundation, Inc...
(gdb) run -c -h -a -p -b -z /usr/tmp/L fixundsdfdi.ln
Starting program: /usr/libexec/lint1 -c -h -a -p -b -z /usr/tmp/L fixundsdfdi.ln
^C
Program received signal SIGINT, Interrupt.
0x4009288d in memchr ()
(gdb) bt
#0  0x4009288d in memchr ()
#1  0xefbfc918 in ?? ()
#2  0x40093276 in memchr ()
#3  0x40093bb5 in strtod ()
#4  0x86c3 in fcon () at /usr/src/usr.bin/xlint/lint1/scan.l:689
#5  0x5adc in yylex () at /usr/src/usr.bin/xlint/lint1/scan.l:105
#6  0x1dc2 in yyparse () at cgram.c:1393
#7  0xe40d in main (argc=2, argv=0xefbfcafc)
    at /usr/src/usr.bin/xlint/lint1/main1.c:161
(gdb) frame 4
#4  0x86c3 in fcon () at /usr/src/usr.bin/xlint/lint1/scan.l:689
689             d = strtod(cp, &eptr);
(gdb) print cp
$1 = 0x32814 "18446744073709551615.0"