This is the mail archive of the
cygwin@sourceware.cygnus.com
mailing list for the Cygwin project.
Re: B19: gcc/libc bug with call to atof() (Win95)
- To: Martin Hansen <m dot hansen at widex dot com>
- Subject: Re: B19: gcc/libc bug with call to atof() (Win95)
- From: Mumit Khan <khan at xraylith dot wisc dot edu>
- Date: Wed, 28 Oct 1998 10:49:33 -0600 (CST)
- Cc: gnu-win32 at cygnus dot com
- Reply-To: Mumit Khan <khan at xraylith dot wisc dot edu>
On Tue, 27 Oct 1998, Martin Hansen wrote:
> The following small program produces the bug:
[ ... ]
> The program compiles and I don't get any error about the missing line
> "#include <stdlib.h>", where atoi() and atof() are declared. (This is
> the bug, part1)
Sorry, but your code is buggy. You *must* prototype atof before using
it, otherwise the default return type in C is "int" and obviously you
get garbage in this case. Either include <stdlib.h> or declare it
yourself.
$ gcc -c -Wall file.c
is a good check before blaming the compiler ...
Also, you probably should upgrade your compiler tools to egcs. See
Cygnus home page for link back to mine.
Regards,
Mumit
-
For help on using this list (especially unsubscribing), send a message to
"gnu-win32-request@cygnus.com" with one line of text: "help".