Date: Tue, 28 Apr 1998 13:42:15 +0300 (IDT) From: Eli Zaretskii To: Daniel Delorme cc: djgpp AT delorie DOT com Subject: Re: SIGFPE In-Reply-To: <3.0.3.32.19980427165510.006a0c40@ns.coba.net> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Precedence: bulk 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.