From owner-freebsd-hackers Fri Aug 28 09:44:24 1998 Return-Path: Received: (from majordom@localhost) by hub.freebsd.org (8.8.8/8.8.8) id JAA14626 for freebsd-hackers-outgoing; Fri, 28 Aug 1998 09:44:24 -0700 (PDT) (envelope-from owner-freebsd-hackers@FreeBSD.ORG) Received: from word.smith.net.au (castles225.castles.com [208.214.165.225]) by hub.freebsd.org (8.8.8/8.8.8) with ESMTP id JAA14606 for ; Fri, 28 Aug 1998 09:44:16 -0700 (PDT) (envelope-from mike@word.smith.net.au) Received: from word.smith.net.au (LOCALHOST [127.0.0.1]) by word.smith.net.au (8.9.1/8.8.8) with ESMTP id JAA05495; Fri, 28 Aug 1998 09:41:29 GMT (envelope-from mike@word.smith.net.au) Message-Id: <199808280941.JAA05495@word.smith.net.au> X-Mailer: exmh version 2.0.2 2/24/98 To: Tim Borgeaud cc: freebsd-hackers@FreeBSD.ORG Subject: Re: Why is my code failing with SIGFPE? In-reply-to: Your message of "Fri, 28 Aug 1998 17:14:45 +0100." <199808281614.RAA27907@zeus.bris.ac.uk> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Date: Fri, 28 Aug 1998 09:41:28 +0000 From: Mike Smith Sender: owner-freebsd-hackers@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG > Apologies to all. I have managed to find the problem in my code. > > I had missed out one of my include files. This had lead to a function being > implicitly declared rather than declared as a function returning a double. > > After browsing the mail archives and some careful attention to compiling > I found the error. I forget who wrote the message that described this function > misdeclaration as a cause of SIGFPE. Thanks to whoever it was. > > Is this kind of behaviour from the compiler unavoidable? It took me ages to > track down the bloody problem. As a novice programmer I was confused by the > floating point exception and spent a long time wondering how my variables could > have gone out of range. It's a lesson: always study the compiler output. If you're just starting out, make sure you add '-ansi -Wall -Werror' to your compiler flags. This'll get you playing more attention to it. 8) -- \\ Sometimes you're ahead, \\ Mike Smith \\ sometimes you're behind. \\ mike@smith.net.au \\ The race is long, and in the \\ msmith@freebsd.org \\ end it's only with yourself. \\ msmith@cdrom.com To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-hackers" in the body of the message