This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
c++/581: divide by zero and floating point exceptions not caught
- To: gcc-gnats at gcc dot gnu dot org
- Subject: c++/581: divide by zero and floating point exceptions not caught
- From: Hugo dot Mildenberger at topmail dot de
- Date: 29 Sep 2000 15:49:41 -0000
- Reply-To: Hugo dot Mildenberger at topmail dot de
- Resent-Cc: gcc-prs at gcc dot gnu dot org, gcc-bugs at gcc dot gnu dot org, jason at gcc dot gnu dot org
- Resent-Reply-To: gcc-gnats@gcc.gnu.org, Hugo.Mildenberger@topmail.de
>Number: 581
>Category: c++
>Synopsis: divide by zero and floating point exceptions not caught
>Confidential: no
>Severity: serious
>Priority: high
>Responsible: unassigned
>State: open
>Class: sw-bug
>Submitter-Id: net
>Arrival-Date: Fri Sep 29 08:56:00 PDT 2000
>Closed-Date:
>Last-Modified:
>Originator: Hugo Mildenberger
>Release: gcc-2.9.2 and latest snapshots
>Organization:
>Environment:
linux-4-0-test8, glibc-2.1
>Description:
Division by zero and floating point exceptions are not
caught by a general catch(...) handler. Instead the program
is aborted with the "Floating point exception" message.
>How-To-Repeat:
g++ -fexceptions -O0
include <stdio.h>
int main()
{
try {
printf("hello 1\n");
int r=1;
int k=0;
int j=r/k;
printf("no exception 1\n");
}
catch(...)
{
printf("exception caught 1\n");
}
try {
printf("hello 2\n");
double r=1;
double k=0;
double j=r/k;
printf("no exception 2\n");
}
catch(...)
{
printf("exception caught 2\n");
}
printf("leaving\n");
return 0;
}
>Fix:
>Release-Note:
>Audit-Trail:
>Unformatted: