Mail Archives: djgpp/1998/04/28/06:42:44
On Mon, 27 Apr 1998, Daniel Delorme wrote:
> >runs fine for me...
> >first file:
> >#include "stdio.h"
> >double ReturnDouble(int I);
> >main()
> >{
> >[...]
>
> Since you declare the function in the first file, it's no wonder the
> program runs fine. It's as if the two functions are in the same file,
> and I never had any trouble with that
>
> Just try to remove "double ReturnDouble(int I);" from the first file :)
Why do you insist on writing buggy programs even *after* people here
have told you how to do it *right*? Your problem was *exactly* that
you did NOT put the line with the prototype of `ReturnDouble' in the
file where it is called. Without the prototype, the compiler assumes
that it returns an int, so you have your SIGFPE. You *need* this
prototype, or else your program won't work.
As an aside, if you use the -Wall switch to gcc when compiling, it
complains about these cases.
- Raw text -