This is the mail archive of the gcc-prs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

c++/581: divide by zero and floating point exceptions not caught



>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:

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]