[gnu.gdb.bug] strtod

raulmill%aludra.usc.edu@usc.edu (Raul Deluth Rockwell) (11/20/89)

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  !

kingdon@AI.MIT.EDU (Jim Kingdon) (11/21/89)

	(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")