From: Christian Thalinger <e9625286@student.tuwien.ac.at>
To: "Richard B. Johnson" <root@chaos.analogic.com>
Cc: Zwane Mwaikambo <zwane@linux.realnet.co.sz>,
linux-kernel <linux-kernel@vger.kernel.org>
Subject: Re: floating point exception
Date: 15 Jan 2002 19:49:11 +0100 [thread overview]
Message-ID: <1011120551.13266.2.camel@sector17.home.at> (raw)
In-Reply-To: <Pine.LNX.3.95.1020115132921.818A-100000@chaos.analogic.com>
In-Reply-To: <Pine.LNX.3.95.1020115132921.818A-100000@chaos.analogic.com>
On Tue, 2002-01-15 at 19:31, Richard B. Johnson wrote:
> On 15 Jan 2002, Christian Thalinger wrote:
>
> > On Tue, 2002-01-15 at 15:34, Zwane Mwaikambo wrote:
> > > On 14 Jan 2002, Christian Thalinger wrote:
> [SNIPPED...]
>
> >
> > Tried this:
> >
> > #define _GNU_SOURCE 1
> > #include <fenv.h>
> >
> > main() {
> > double zero=0.0;
> > double one=1.0;
> >
> > feenableexcept(FE_ALL_EXCEPT);
> >
> > one /=zero;
> > }
> >
> Well, that won't even link. The source I showed previously
> compiles and link fine. It also shows a FPU exception when
> one divides by zero:
>
> Script started on Tue Jan 15 13:27:05 2002
> # gcc -o zzz zzz.c -lm
> /tmp/ccjhyGHj.o: In function `main':
> /tmp/ccjhyGHj.o(.text+0x25): undefined reference to `feenableexcept'
> collect2: ld returned 1 exit status
This depends on the libc version. Seems you have 2.1. For me it's 2.2.
[root@sector17:/root/src]# cat fpu-exception.c
#define _GNU_SOURCE 1
#include <fenv.h>
main() {
double zero=0.0;
double one=1.0;
feenableexcept(FE_ALL_EXCEPT);
one /=zero;
}
[root@sector17:/root/src]# gcc -Wall -lm -o fpu-exception
fpu-exception.c
fpu-exception.c:4: warning: return type defaults to `int'
fpu-exception.c: In function `main':
fpu-exception.c:11: warning: control reaches end of non-void function
[root@sector17:/root/src]# ./fpu-exception
Floating point exception
[root@sector17:/root/src]#
next prev parent reply other threads:[~2002-01-15 18:50 UTC|newest]
Thread overview: 27+ messages / expand[flat|nested] mbox.gz Atom feed top
2002-01-14 10:56 floating point exception Zwane Mwaikambo
2002-01-14 21:26 ` Christian Thalinger
2002-01-15 14:34 ` Zwane Mwaikambo
2002-01-15 14:46 ` Richard B. Johnson
2002-01-15 18:19 ` Christian Thalinger
2002-01-15 18:31 ` Richard B. Johnson
2002-01-15 18:49 ` Christian Thalinger [this message]
2002-01-16 5:45 ` Zwane Mwaikambo
2002-01-16 11:55 ` Christian Thalinger
2002-01-16 14:32 ` Zwane Mwaikambo
2002-01-16 20:26 ` Christian Thalinger
2002-01-16 21:23 ` Richard B. Johnson
2002-01-16 21:59 ` Brian Gerst
2002-01-16 22:05 ` Richard B. Johnson
2002-01-16 22:12 ` Mark Zealey
2002-01-16 22:23 ` Richard B. Johnson
2002-01-16 23:35 ` Christian Thalinger
-- strict thread matches above, loose matches on Subject: below --
2002-12-27 14:18 Floating Point Exception Nandakumar NarayanaSwamy
2002-01-13 12:43 floating point exception Christian Thalinger
2002-01-15 23:28 ` Brian Gerst
2002-01-16 11:45 ` Christian Thalinger
2002-01-16 11:58 ` Dave Jones
2002-01-16 13:14 ` Bruce Harada
2002-01-16 20:06 ` Christian Thalinger
2002-01-17 19:26 ` bill davidsen
2002-01-16 13:52 ` Brian Gerst
2002-01-16 14:28 ` M. Edward (Ed) Borasky
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1011120551.13266.2.camel@sector17.home.at \
--to=e9625286@student.tuwien.ac.at \
--cc=linux-kernel@vger.kernel.org \
--cc=root@chaos.analogic.com \
--cc=zwane@linux.realnet.co.sz \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox