Thread View: gnu.gdb.bug
2 messages
2 total messages
Started by Raul Deluth Rockwell
Mon, 20 Nov 1989 01:45
strtod
Author: Raul Deluth Rockwell
Date: Mon, 20 Nov 1989 01:45
Date: Mon, 20 Nov 1989 01:45
24 lines
1322 bytes
1322 bytes
Standard C (P.J. Plauger & Jim Brodie, Microsoft Press 1989, p163):
double strtod(const char *s, char **endptr);
GDB 3.4 (FSF 1989):
(gdb) whatis strtod
type = int ()
(gdb) print strtod("0", 0)
$2 = 81368
----------------------------------------------------------------------
There may be a problem with gcc as well, as I was running into a
problem with code using strtod until I added a line that said
extern double strtod();
As I am still debugging, and as I can't rely on gdb here to give me a
picture of what is going on, I don't really know if there is a gcc
bug. [Incidentally, the extern declaration is present for the gdb
invocation which thought that strtod is an int type.]
Raul Rockwell
INTERNET: raulmill@usc.edu !
UUCP: ...uunet!usc!raulmill ! 55 mph = 82 nc
U.S.SNAIL: 721 E Windsor #4, GLENDALE CA 91205 !
strtod
Author: Jim Kingdon
Date: Mon, 20 Nov 1989 21:34
Date: Mon, 20 Nov 1989 21:34
10 lines
712 bytes
712 bytes
(gdb) whatis strtod
type = int ()
This is a common problem, but is not GDB's fault. The problem is that
your system library was not compiled with -g, so GDB does not know the
type of strtod.
Recompile your system library -g if you have source, or use casts, e.g.
(gdb) print ((double (*)())&atof)("1.55")
Thread Navigation
This is a paginated view of messages in the thread with full content displayed inline.
Messages are displayed in chronological order, with the original post highlighted in green.
Use pagination controls to navigate through all messages in large threads.
Back to All Threads